From 89eedf0a485f5eb2d94dc65b0f63f98e7c99e081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 8 Apr 2026 12:02:16 +0200 Subject: [PATCH 1/4] [ci] Build (and test) on Linux --- .github/workflows/build.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f95030..5f9913a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ env: Solution: windows/libmysofa.sln Configuration: Release Artifacts: windows/bin/x64/Release - + on: push: Branches: $Branch @@ -14,6 +14,26 @@ on: workflow_dispatch: jobs: + + Linux: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: sudo apt-get install -y zlib1g-dev libcunit1-dev + + - name: Checkout code + uses: actions/checkout@v6 + with: + submodules: true + + - name: Build Project + id: build + uses: threeal/cmake-action@v2.1.0 + with: + build-dir: _build + - name: Run tests + run: cmake --build ${{ steps.build.outputs.build-dir }} -t test + Windows: runs-on: windows-latest steps: From 90d9b2315860ad415fdbcdbd62a2c3e59863fe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 8 Apr 2026 14:45:44 +0200 Subject: [PATCH 2/4] [ci] use a separate job for extracting commit meta info --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f9913a..023089f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,25 @@ on: workflow_dispatch: jobs: + CommitInfo: + # proudust/gh-describe@v2 might be useful, but provides neither date nor absolute count + runs-on: ubuntu-latest + outputs: + date: ${{ steps.ghd.outputs.Date }} + hash: ${{ steps.ghd.outputs.Hash }} + count: ${{ steps.ghd.outputs.Count }} + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + fetch-tags: true + - name: Get current date, commit hash and count + id: ghd + run: | + echo "Date=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" | tee -a $GITHUB_OUTPUT + echo "Hash=$(git rev-parse --short=7 HEAD)" | tee -a $GITHUB_OUTPUT + echo "Count=$(git rev-list --count HEAD)" | tee -a $GITHUB_OUTPUT Linux: runs-on: ubuntu-latest @@ -36,16 +55,13 @@ jobs: Windows: runs-on: windows-latest + needs: + - CommitInfo steps: - - name: Clone repo and submodules - run: git clone --recurse-submodules https://github.com/${{github.repository}}.git . --branch ${{env.Branch}} - - - name: Get current date, commit hash and count - run: | - echo "CommitDate=$(git show -s --date=format:'%Y-%m-%d' --format=%cd)" >> $env:GITHUB_ENV - echo "CommitHashShort=$(git rev-parse --short=7 HEAD)" >> $env:GITHUB_ENV - echo "CommitCount=$(git rev-list --count HEAD)" >> $env:GITHUB_ENV + uses: actions/checkout@v6 + with: + submodules: true - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v1.0.2 @@ -57,7 +73,7 @@ jobs: - name: Upload Installer Artifact to GitHub uses: actions/upload-artifact@v4 with: - name: "${{github.event.repository.name}}_r${{env.CommitCount}}@${{env.CommitHashShort}}" + name: "${{github.event.repository.name}}_r${{needs.CommitInfo.outputs.count}}@${{needs.CommitInfo.outputs.hash}}" path: "${{github.workspace}}/${{env.Artifacts}}/" - name: GitHub pre-release @@ -66,5 +82,5 @@ jobs: repo_token: "${{secrets.GITHUB_TOKEN}}" automatic_release_tag: "latest" prerelease: true - title: "[${{env.CommitDate}}] ${{github.event.repository.name}} r${{env.CommitCount}}@${{env.CommitHashShort}}" + title: "[${{needs.CommitInfo.outputs.date}}] ${{github.event.repository.name}} r${{needs.CommitInfo.outputs.count}}@${{needs.CommitInfo.outputs.hash}}" files: "${{env.Artifacts}}/*" From 07ee3b9501520bae120ec9ce6edc79814604297c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 8 Apr 2026 14:46:15 +0200 Subject: [PATCH 3/4] [ci] only run pre-release jobs if "Linux" build succeeded --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 023089f..f5f6dba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,7 @@ jobs: runs-on: windows-latest needs: - CommitInfo + - Linux steps: - name: Clone repo and submodules uses: actions/checkout@v6 From d4c7c7cf0df72ce2b39d5d4ea8da725c2dc9e531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 8 Apr 2026 14:52:51 +0200 Subject: [PATCH 4/4] [ci] separate PreRelease job --- .github/workflows/build.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5f6dba..a47c5ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,6 @@ jobs: runs-on: windows-latest needs: - CommitInfo - - Linux steps: - name: Clone repo and submodules uses: actions/checkout@v6 @@ -75,7 +74,17 @@ jobs: uses: actions/upload-artifact@v4 with: name: "${{github.event.repository.name}}_r${{needs.CommitInfo.outputs.count}}@${{needs.CommitInfo.outputs.hash}}" - path: "${{github.workspace}}/${{env.Artifacts}}/" + path: "${{ github.workspace }}/${{ env.Artifacts }}/" + + PreRelease: + runs-on: ubuntu-latest + needs: + - CommitInfo + - Windows + - Linux + steps: + - name: Fetch artifacts + uses: actions/download-artifact@v5 - name: GitHub pre-release uses: "marvinpinto/action-automatic-releases@latest" @@ -84,4 +93,4 @@ jobs: automatic_release_tag: "latest" prerelease: true title: "[${{needs.CommitInfo.outputs.date}}] ${{github.event.repository.name}} r${{needs.CommitInfo.outputs.count}}@${{needs.CommitInfo.outputs.hash}}" - files: "${{env.Artifacts}}/*" + files: "*"