Build aom-psy101 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build aom-psy101 | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
arch: [ | |
'x86-64', 'x86-64-v2', 'x86-64-v3', 'x86-64-v4', | |
'znver1', 'znver2', 'znver3', 'znver4', 'znver5', | |
'haswell', 'broadwell', 'skylake', | |
'rocketlake', 'alderlake', 'raptorlake' | |
] | |
steps: | |
- name: Install dependencies | |
uses: azure/chocolatey-action@v2 | |
with: | |
command: install | |
packages: llvm,nasm,ninja,git,strawberryperl,7zip | |
- name: Clone repository | |
run: | | |
git clone --depth 1 https://gitlab.com/damian101/aom-psy101.git . | |
$commit = git rev-parse HEAD | |
echo "COMMIT=$commit" >> $env:GITHUB_ENV | |
- name: Configure and Build | |
run: | | |
cmake --fresh -B aom_build -G Ninja ` | |
-DBUILD_SHARED_LIBS=0 ` | |
-DENABLE_DOCS=0 ` | |
-DCONFIG_TUNE_BUTTERAUGLI=0 ` | |
-DCONFIG_TUNE_VMAF=0 ` | |
-DCONFIG_AV1_DECODER=0 ` | |
-DENABLE_TESTS=0 ` | |
-DCMAKE_BUILD_TYPE=Release ` | |
-DCMAKE_CXX_FLAGS="-flto -march=${{ matrix.arch }}" ` | |
-DCMAKE_C_FLAGS="-flto -march=${{ matrix.arch }}" | |
ninja -C aom_build | |
- name: Create architecture-specific directory and move aomenc.exe | |
run: | | |
Move-Item aom_build/aomenc.exe "aom_build/${{ matrix.arch }}/" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aomenc-${{ matrix.arch }} | |
path: aom_build/${{ matrix.arch }}/aomenc.exe | |
retention-days: 7 | |
- name: Save commit SHA | |
run: | | |
echo "${{ env.COMMIT }}" > commit.txt | |
echo "COMMIT=${{ env.COMMIT }}" >> $env:GITHUB_ENV | |
- name: Upload commit SHA | |
uses: actions/upload-artifact@v4 | |
with: | |
name: commit-sha | |
path: commit.txt | |
retention-days: 7 | |
package: | |
needs: build | |
runs-on: windows-latest | |
steps: | |
- name: Cache Chocolatey packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.chocolatey | |
key: chocolatey-${{ runner.os }} | |
- name: Install 7-Zip | |
run: choco install 7zip -y | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
merge-multiple: true | |
- name: Get commit SHA | |
run: | | |
$commit = Get-Content artifacts/commit.txt | |
echo "COMMIT=$commit" >> $env:GITHUB_ENV | |
- name: Move executables to build directory | |
run: | | |
mkdir aom_build | |
Move-Item artifacts/aomenc-* aom_build/ | |
- name: Create 7z archive | |
run: | | |
7z a -t7z -mx=9 aom_build.7z ./aom_build/* | |
- name: Calculate SHA256 | |
run: | | |
$hash = (Get-FileHash -Algorithm SHA256 -Path aom_build.7z).Hash.ToLower() | |
echo "HASH=$hash" >> $env:GITHUB_ENV | |
echo "$hash" > sha256sum.txt | |
- name: Upload final package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aom-psy-${{ env.COMMIT }} | |
path: | | |
aom_build.7z | |
sha256sum.txt | |
retention-days: 7 |