CI: Prevent build artifact creation for macOS without pushed tag

Pushes to master will use faster Ninja builds on macOS, which cannot
generate macOS app bundles anymore. Thus packaging will only work with
PR pushes (and the "Seeking Testers" label set) or upon pushing a
release tag to the master branch.
This commit is contained in:
PatTheMav 2023-03-27 00:42:38 +02:00 committed by Ryan Foster
parent 82f7a47438
commit dc39edb23c

View file

@ -156,14 +156,22 @@ jobs:
fi
- name: 'Create build artifact'
if: ${{ success() && fromJSON(needs.config.outputs.create_artifacts) }}
if: ${{ fromJSON(needs.config.outputs.create_artifacts) }}
run: |
CI/macos/03_package_obs.sh --codesign --architecture "${{ matrix.arch }}"
ARTIFACT_NAME=$(basename $(/usr/bin/find build_${{ matrix.arch }} -type f -name "obs-studio-*.dmg" -depth 1 | head -1))
echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
: ${PACKAGE:=}
case "${GITHUB_EVENT_NAME}" in
push) if [[ ${GITHUB_REF_NAME} =~ [0-9]+.[0-9]+.[0-9]+(-(rc|beta).+)? ]]; then PACKAGE=1; fi ;;
pull_request) PACKAGE=1 ;;
esac
if [[ "${PACKAGE}" ]]; then
CI/macos/03_package_obs.sh --codesign --architecture "${{ matrix.arch }}"
ARTIFACT_NAME=$(basename $(/usr/bin/find build_${{ matrix.arch }} -type f -name "obs-studio-*.dmg" -depth 1 | head -1))
echo "FILE_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
fi
- name: 'Upload build Artifact'
if: ${{ success() && fromJSON(needs.config.outputs.create_artifacts) }}
if: ${{ fromJSON(needs.config.outputs.create_artifacts) && env.FILE_NAME != '' }}
uses: actions/upload-artifact@v3
with:
name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'