osx build #242
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: osx build | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build-x64: | |
runs-on: [self-hosted, macos, x64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
if [ "$GITHUB_REF_NAME" != "main" ]; then | |
bash osx/build-nzbget.sh x64 testing | |
else | |
bash osx/build-nzbget.sh x64 | |
fi | |
- name: Upload full build log on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: nzbget-osx-x64-build-log | |
path: build/*/build.log | |
retention-days: 5 | |
- name: Rename build artifacts | |
if: github.ref_name != 'main' && github.ref_name != 'develop' | |
run: | | |
cd build | |
SUFFIX="${GITHUB_REF_NAME/\//-}" | |
for FILE in *.zip; do | |
[ -f $FILE ] || continue | |
NEW_FILE=${FILE/-bin-macos-x64.zip/-$SUFFIX-bin-macos-x64.zip} | |
mv $FILE $NEW_FILE | |
done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers-x64 | |
path: build/*.zip | |
retention-days: 5 | |
build-universal: | |
runs-on: [self-hosted, macos, arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
if [ "$GITHUB_REF_NAME" != "main" ]; then | |
bash osx/build-nzbget.sh universal testing | |
else | |
bash osx/build-nzbget.sh universal | |
fi | |
- name: Upload full build log on failure | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: nzbget-osx-universal-build-log | |
path: build/*/build.log | |
retention-days: 5 | |
- name: Rename build artifacts | |
if: github.ref_name != 'main' && github.ref_name != 'develop' | |
run: | | |
cd build | |
SUFFIX="${GITHUB_REF_NAME/\//-}" | |
for FILE in *.zip; do | |
[ -f $FILE ] || continue | |
NEW_FILE=${FILE/-bin-macos-universal.zip/-$SUFFIX-bin-macos-universal.zip} | |
mv $FILE $NEW_FILE | |
done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers-universal | |
path: build/*-universal.zip | |
retention-days: 5 | |
sign-universal: | |
runs-on: [self-hosted, macos, arm64] | |
needs: [build-universal] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
- name: Sign and notarize | |
env: | |
NOTARIZE: ${{ vars.OSX_NOTARIZE }} | |
KEYCHAIN_PASSWORD: ${{ secrets.OSX_KEYCHAIN_PASSWORD }} | |
DEVELOPER_IDENTITY: ${{ secrets.OSX_DEVELOPER_IDENTITY }} | |
NOTARY_KEY_ID: ${{ secrets.OSX_NOTARY_KEY_ID }} | |
NOTARY_KEY_ISSUER: ${{ secrets.OSX_NOTARY_KEY_ISSUER }} | |
run: | | |
mkdir -p build | |
cp osx/sign/* build | |
cp nzbget-osx-installers-universal/*.zip build/ | |
cd build | |
bash nzbget-sign.sh *.zip | |
- name: Upload signed build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers-universal-signed | |
path: build/*.dmg | |
retention-days: 5 | |
combine-osx-artifacts: | |
runs-on: ubuntu-24.04 | |
needs: [build-x64, sign-universal] | |
permissions: | |
actions: write | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
- name: Combine artifacts | |
run: | | |
mkdir -p nzbget-osx-installers | |
mv nzbget-osx-installers-x64/* nzbget-osx-installers | |
mv nzbget-osx-installers-universal-signed/* nzbget-osx-installers | |
- name: Upload combined build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers | |
path: nzbget-osx-installers/* | |
retention-days: 5 | |
- name: Delete unneeded artifacts | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: | | |
nzbget-osx-installers-x64 | |
nzbget-osx-installers-universal | |
nzbget-osx-installers-universal-signed |