Skip to content

Commit

Permalink
get extra args from environment
Browse files Browse the repository at this point in the history
  • Loading branch information
phnzb committed Jan 24, 2025
1 parent 236e152 commit ddcb9d5
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 110 deletions.
218 changes: 110 additions & 108 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
tar zxf $HOME/vcpkg.tar.gz -C $HOME
- name: Build
run: bash osx/build-nzbget.sh x64 ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}
run: |
export EXTRA_ARGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode_14.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14"
bash osx/build-nzbget.sh x64 ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}
- name: Upload full build log on failure
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -51,110 +53,110 @@ jobs:
path: build/*.zip
retention-days: 5

# build-universal:
# runs-on: [self-hosted, macos, arm64]

# steps:

# - name: Checkout
# uses: actions/checkout@v4

# - name: Build
# run: bash osx/build-nzbget.sh universal ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}

# - 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/-$SUFFIX-bin-macos-universal}
# 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_signed
# for FILE in nzbget-osx-installers-universal/*.zip; do
# [ -f $FILE ] || continue
# mkdir -p build
# cp osx/sign/* build
# cp $FILE build/
# cd build
# bash nzbget-sign.sh *.zip
# cd ..
# cp build/*.dmg build_signed
# rm -rf build
# done

# - name: Upload signed build artifacts
# uses: actions/upload-artifact@v4
# with:
# name: nzbget-osx-installers-universal-signed
# path: build_signed/*.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
build-universal:
runs-on: [self-hosted, macos, arm64]

steps:

- name: Checkout
uses: actions/checkout@v4

- name: Build
run: bash osx/build-nzbget.sh universal ${{ env.BUILD_TYPES }} ${{ env.BUILD_TESTING }}

- 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/-$SUFFIX-bin-macos-universal}
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_signed
for FILE in nzbget-osx-installers-universal/*.zip; do
[ -f $FILE ] || continue
mkdir -p build
cp osx/sign/* build
cp $FILE build/
cd build
bash nzbget-sign.sh *.zip
cd ..
cp build/*.dmg build_signed
rm -rf build
done
- name: Upload signed build artifacts
uses: actions/upload-artifact@v4
with:
name: nzbget-osx-installers-universal-signed
path: build_signed/*.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
5 changes: 3 additions & 2 deletions osx/build-nzbget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ for CONFIG in $CONFIGS; do
cd $BUILD_PATH
if [ "$ARCH" == "x64" ]; then
CMAKE_ARCH="x86_64"
CMAKE_EXTRA_ARGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode_14.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14"
else
CMAKE_ARCH=$ARCH
CMAKE_EXTRA_ARGS=""
fi

if [ "$CONFIG" == "debug" ]; then
Expand All @@ -121,6 +119,9 @@ for CONFIG in $CONFIGS; do
SUFFIX=""
fi

# extra args from environment
CMAKE_EXTRA_ARGS=${EXTRA_ARGS:-}

cmake ../.. \
-DENABLE_STATIC=ON \
-DCMAKE_INSTALL_PREFIX="$PWD/../../$NZBGET_PATH/$DAEMON_PATH" \
Expand Down

0 comments on commit ddcb9d5

Please sign in to comment.