Skip to content

Commit

Permalink
Update release pipelines to upload release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
conradev committed Mar 16, 2024
1 parent 4334f8c commit ec2cbd9
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 31 deletions.
5 changes: 3 additions & 2 deletions .github/actions/archive/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ runs:
xcodebuild archive \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-skipPackagePluginValidation \
-skipMacroValidation \
-onlyUsePackageVersionsFromResolvedFile \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
Expand All @@ -38,6 +41,4 @@ runs:
-archivePath '${{ inputs.archive-path }}' \
-resultBundlePath BuildResults.xcresult
./Tools/xcresulttool-github BuildResults.xcresult
rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8
57 changes: 57 additions & 0 deletions .github/actions/notarize/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Notarize
inputs:
app-store-key:
description: App Store key in PEM PKCS#8 format
required: true
app-store-key-id:
description: App Store key ID
required: true
app-store-key-issuer-id:
description: App Store key issuer ID
required: true
archive-path:
description: Xcode archive path
required: true
outputs:
notarized-app:
description: The compressed and notarized app
value: ${{ steps.notarize.outputs.notarized-app }}
runs:
using: composite
steps:
- id: notarize
shell: bash
run: |
echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8
echo '{"destination":"upload","method":"developer-id"}' \
| plutil -convert xml1 -o ExportOptions.plist -
xcodebuild \
-exportArchive \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
-archivePath '${{ inputs.archive-path }}' \
-exportOptionsPlist ExportOptions.plist
until xcodebuild \
-exportNotarizedApp \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
-archivePath '${{ inputs.archive-path }}' \
-exportPath Release
do
echo "Failed to export app, trying again in 10s..."
sleep 10
done
aa archive -a lzma -b 8m -d Release -subdir Burrow.app -o Burrow.app.aar
rm -rf Release
rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8 Release ExportOptions.plist
3 changes: 1 addition & 2 deletions .github/workflows/build-apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
jobs:
build:
name: Build App (${{ matrix.platform }})
runs-on: macos-13
runs-on: macos-14
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -53,7 +53,6 @@ jobs:
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ join(matrix.rust-targets, ', ') }}
- name: Build
id: build
Expand Down
62 changes: 35 additions & 27 deletions .github/workflows/release-apple.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
name: Build Apple Release
on:
release:
types:
- created
push:
branches:
- main
jobs:
build:
name: Build ${{ matrix.configuration['platform'] }} Release
runs-on: macos-13
name: Build ${{ matrix.platform }} Release
runs-on: macos-14
strategy:
fail-fast: false
matrix:
configuration:
- scheme: App (iOS)
destination: generic/platform=iOS
include:
- destination: generic/platform=iOS
platform: iOS
method: ad-hoc
artifact-file: Apple/Release/Burrow.ipa
- scheme: App (macOS)
destination: generic/platform=macOS
rust-targets:
- aarch64-apple-ios
- destination: generic/platform=macOS
platform: macOS
method: mac-application
artifact-file: Burrow.app.txz
rust-targets:
- x86_64-apple-darwin
- aarch64-apple-darwin
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
steps:
Expand All @@ -34,32 +33,41 @@ jobs:
with:
certificate: ${{ secrets.DEVELOPER_CERT }}
password: ${{ secrets.DEVELOPER_CERT_PASSWORD }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ join(matrix.rust-targets, ', ') }}
- name: Archive
uses: ./.github/actions/archive
with:
scheme: ${{ matrix.configuration['scheme'] }}
destination: ${{ matrix.configuration['destination'] }}
scheme: App
destination: ${{ matrix.destination }}
app-store-key: ${{ secrets.APPSTORE_KEY }}
app-store-key-id: ${{ secrets.APPSTORE_KEY_ID }}
app-store-key-issuer-id: ${{ secrets.APPSTORE_KEY_ISSUER_ID }}
archive-path: Burrow.xcarchive
- name: Export Locally
- name: Upload
uses: ./.github/actions/export
with:
method: ${{ matrix.configuration['method'] }}
destination: export
method: app-store
destination: upload
app-store-key: ${{ secrets.APPSTORE_KEY }}
app-store-key-id: ${{ secrets.APPSTORE_KEY_ID }}
app-store-key-issuer-id: ${{ secrets.APPSTORE_KEY_ISSUER_ID }}
archive-path: Burrow.xcarchive
export-path: Release
- name: Notarize
if: ${{ matrix.platform == 'macOS' }}
uses: ./.github/actions/notarize
with:
app-store-key: ${{ secrets.APPSTORE_KEY }}
app-store-key-id: ${{ secrets.APPSTORE_KEY_ID }}
app-store-key-issuer-id: ${{ secrets.APPSTORE_KEY_ISSUER_ID }}
archive-path: Burrow.xcarchive
product-name: Burrow.app
- name: Compress
if: ${{ matrix.configuration['platform'] == 'macOS' }}
shell: bash
run: tar --options xz:compression-level=9 -C Apple/Release -cJf Burrow.app.txz ./
- name: Attach Artifact
uses: SierraSoftworks/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
overwrite: 'false'
files: ${{ matrix.configuration['artifact-file'] }}
run: |
mkdir Artifacts
mv Burrow.app.aar Artifacts
aa archive -a lzma -b 8m -d . -subdir Burrow.xcarchive -o Artifacts/Burrow-${{ matrix.platform }}.xcarchive.aar

0 comments on commit ec2cbd9

Please sign in to comment.