From 803dc8d40df7fee5f53d82536c7bd7a67787dbfd Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Wed, 30 Oct 2024 08:44:54 +0100 Subject: [PATCH] Add CI for MSYS2, and package build as artifact --- .github/workflows/action.yml | 2 +- .github/workflows/msys2.yml | 54 +++++++++++++++++++++++++++++++++++ .github/workflows/options.yml | 2 +- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/msys2.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index b9e09c1cb1..9a5bd50089 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -1,4 +1,4 @@ -name: GitHub Actions +name: Generic cross-platform tests on: push: diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml new file mode 100644 index 0000000000..2cc7a0ac7e --- /dev/null +++ b/.github/workflows/msys2.yml @@ -0,0 +1,54 @@ +name: Build on MSYS2 + +on: [ push, pull_request ] + +jobs: + build: + runs-on: windows-latest + steps: + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + install: autotools mingw-w64-x86_64-gcc mingw-w64-x86_64-libogg + + - name: Install pandoc + run: | + choco install pandoc + + - name: Build, run tests and prepare package + shell: msys2 {0} + run: | + PATH=$PATH:/c/ProgramData/chocolatey/bin/ + ./autogen.sh + ./configure --enable-static --disable-shared # This is because the libtool helper script doesn't handle UTF-8 filenames correctly + make LDFLAGS='-all-static' # Otherwise ogg isn't linked statically + make check + mkdir flac + cp src/flac/flac.exe flac/flac.exe + cp src/metaflac/metaflac.exe flac/metaflac.exe + strip flac/*.exe + cp COPYING.* flac + cp AUTHORS flac + cp README* flac + cp man/*.html flac + + - name: Upload logs on failure + uses: actions/upload-artifact@v4 + if: failure() + with: + name: flac-${{ github.sha }}-${{ github.run_id }}-logs + path: | + ./**/*.log + ./**/out*.meta + + - name: Package build + uses: actions/upload-artifact@v4 + with: + name: flac-win64-static-${{ github.sha}} + path: flac diff --git a/.github/workflows/options.yml b/.github/workflows/options.yml index b25fb1b9b8..1bfa27debd 100644 --- a/.github/workflows/options.yml +++ b/.github/workflows/options.yml @@ -1,4 +1,4 @@ -name: GitHub Actions for specific options +name: Building with specific options on: push: