CI: Trigger Windows build when a tag is pushed

AppVeyor ran our CI build when both branches and tags were pushed.  This
is necessary to support signing with SignPath.io, since we only sign
releases and not pre-releases.  However, due to an oversight in
9af8cca75c, the global on: dictionary
excluded tag pushes.

To simulate the previous AppVeyor CI environment:
- Run all jobs regardless of whether a branch or a tag was pushed.
- Use the if: key to exclude all jobs except "windows" from tag pushes.
This commit is contained in:
DRC
2025-05-18 08:49:12 -04:00
parent 0bf816644a
commit 024e10f3c9

View File

@@ -2,13 +2,12 @@ name: Build
on:
push:
branches:
- '**'
pull_request:
workflow_dispatch:
jobs:
linux:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Set global environment variables
@@ -49,6 +48,7 @@ jobs:
run: |
aws s3 sync --acl public-read --delete $HOME/src/ljt.nightly/latest/files/ s3://libjpeg-turbo-pr/${{env.BRANCH}}/${{github.job}}/
macos:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: macos-13
steps:
- name: Set global environment variables
@@ -87,12 +87,19 @@ jobs:
windows:
runs-on: windows-2025
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set global environment variables
shell: bash
run: |
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
if [[ $GITHUB_REF == refs/tags/* ]]; then
RAWBRANCH=$(git branch -r --contains $GITHUB_REF)
echo "BRANCH=${RAWBRANCH##*/}" >$GITHUB_ENV
else
echo "BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >$GITHUB_ENV
fi
- name: Set up build
shell: bash
run: |
@@ -181,6 +188,7 @@ jobs:
github-artifact-id: ${{steps.upload-unsigned-artifact.outputs.artifact-id}}
wait-for-completion: true
linux-asan-ubsan:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -205,6 +213,7 @@ jobs:
JSIMD_FORCENONE=1 ctest -j$NUMCPUS
popd
linux-jpeg7:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -230,6 +239,7 @@ jobs:
JSIMD_FORCENONE=1 ctest -j$NUMCPUS
popd
linux-jpeg8:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Check out code
@@ -255,6 +265,7 @@ jobs:
JSIMD_FORCENONE=1 ctest -j$NUMCPUS
popd
linux-msan:
if: ${{!contains(github.ref, 'refs/tags/')}}
runs-on: ubuntu-latest
steps:
- name: Check out code