osx build #72
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 | |
with: | |
fetch-depth: 0 | |
- name: Change version for non-release | |
if: github.ref_name != 'main' | |
run: | | |
VERSION=$(grep "set(VERSION" CMakeLists.txt | cut -d '"' -f 2) | |
NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" | |
echo NEW_VERSION=$NEW_VERSION >> $GITHUB_ENV | |
- name: Build | |
run: | | |
bash osx/build-nzbget-x64.sh | |
- name: Rename build artifacts | |
if: github.ref_name != 'main' && github.ref_name != 'develop' | |
run: | | |
cd tmp | |
NEW_VERSION_FEATURE="$NEW_VERSION-${GITHUB_REF_NAME/\//-}" | |
for FILE in *.zip; do | |
[ -f $FILE ] || continue | |
NEW_FILE=${FILE/$NEW_VERSION/$NEW_VERSION_FEATURE} | |
mv $FILE $NEW_FILE | |
done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers-x64 | |
path: tmp/*.zip | |
retention-days: 5 | |
build-universal: | |
runs-on: [self-hosted, macos, arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Change version for non-release | |
if: github.ref_name != 'main' | |
run: | | |
VERSION=$(cat configure.ac | grep AC_INIT | cut -d , -f 2 | xargs) | |
NEW_VERSION="$VERSION-testing-$(date '+%Y%m%d')" | |
sed -e "s|AC_INIT(nzbget.*|AC_INIT(nzbget, $NEW_VERSION, https://github.com/nzbgetcom/nzbget/issues)|g" -i '' configure.ac | |
echo NEW_VERSION=$NEW_VERSION >> $GITHUB_ENV | |
- name: Build | |
run: | | |
bash osx/build-nzbget-universal.sh | |
- name: Rename build artifacts | |
if: github.ref_name != 'main' && github.ref_name != 'develop' | |
run: | | |
cd osx/build/Release | |
NEW_VERSION_FEATURE="$NEW_VERSION-${GITHUB_REF_NAME/\//-}" | |
for FILE in *.zip; do | |
[ -f $FILE ] || continue | |
NEW_FILE=${FILE/$NEW_VERSION/$NEW_VERSION_FEATURE} | |
mv $FILE $NEW_FILE | |
done | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers-universal | |
path: osx/build/Release/*.zip | |
retention-days: 5 | |
combine-osx-artifacts: | |
runs-on: ubuntu-latest | |
needs: [build-x64, build-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/* nzbget-osx-installers | |
- name: Upload build artifacts with signatures | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nzbget-osx-installers | |
path: nzbget-osx-installers/* | |
retention-days: 5 | |
- name: Delete unneded artifacts | |
uses: geekyeggo/delete-artifact@v4 | |
with: | |
name: | | |
nzbget-osx-installers-x64 | |
nzbget-osx-installers-universal |