Skip to content

Copy artifact as post build step on release #11

Copy artifact as post build step on release

Copy artifact as post build step on release #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+'
jobs:
build:
name: Build release
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Configure Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Load secrets
run: echo "tfl_app_key=${{ secrets.TFL_APP_KEY }}" > shared/secret.properties
- name: Build
run: |
xcodebuild -project macOS/Arrivals.xcodeproj \
-scheme Arrivals \
-configuration Release build
- name: Sign
env:
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
ARTIFACT_PATH: "macOS/target/Arrivals.app"
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --deep --timestamp --options runtime "$ARTIFACT_PATH" -v
- name: Notarize
env:
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
ARTIFACT_PATH: "macOS/target/Arrivals.app"
run: |
xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
ditto -c -k --keepParent "$ARTIFACT_PATH" "arrivals-upload.zip"
xcrun notarytool submit "arrivals-upload.zip" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple "$ARTIFACT_PATH"
ditto -c -k --keepParent "$ARTIFACT_PATH" "ArrivalsMac.zip"
- uses: actions/upload-artifact@v3
with:
name: Arrivals
path: ./ArrivalsMac.zip