Skip to content

Commit

Permalink
Add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
saagarjha committed Jan 27, 2024
1 parent b457217 commit e850466
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Release

on:
push:
paths:
- Configs/Deployment.xcconfig

jobs:
upload:
runs-on: macos-13
environment: Release
env:
XCODEBUILD_EXTRA_ARGS: >
-allowProvisioningUpdates
-authenticationKeyPath /tmp/AuthKey.p8
-authenticationKeyID ${{ secrets.AUTHENTICATION_KEY_ID }}
-authenticationKeyIssuerID ${{ secrets.AUTHENTICATION_KEY_ISSUER_ID }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Create App Store Connect Key file
run: echo "${{ secrets.APP_STORE_CONNECT_KEY }}" | base64 -d > /tmp/AuthKey.p8

- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.2.app

- name: Set up visionOS SDK
run: |
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
- name: System Info
run: |
uname -a
xcodebuild -version
- name: Archive macOS
run: xcodebuild $XCODEBUILD_EXTRA_ARGS -scheme macOS -archivePath macOS.xcarchive archive

- name: Archive visionOS
run: xcodebuild $XCODEBUILD_EXTRA_ARGS -scheme visionOS -archivePath visionOS.xcarchive archive

- name: Create Release
run: |
commit="$(git rev-parse HEAD)"
version="$(cat Configs/Deployment.xcconfig | grep CURRENT_PROJECT_VERSION | awk '{ print $3 }')"
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.repository.name }}/git/refs \
-d "{'ref':'refs/tags/v$version','sha':'$commit'}"
curl -L -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.event.repository.name }}/releases \
-d "{'tag_name':'v$version','target_commitish':'$commit','name':'Build $version','body':'','draft':false,'prerelease':true,'generate_release_notes':false}"
# - name: Upload macOS
# run: xcodebuild -exportArchive -exportOptionsPlist Release/ExportOptions.plist -archivePath MacCast-macOS.xcarchive/ -exportPath macOS

# - name: Upload visionOS
# run: xcodebuild -exportArchive -exportOptionsPlist Release/ExportOptions.plist -archivePath MacCast-visionOS.xcarchive/ -exportPath visionOS
14 changes: 14 additions & 0 deletions Release/ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>upload</string>
<key>manageAppVersionAndBuildNumber</key>
<false/>
<key>method</key>
<string>app-store-connect</string>
<key>stripSwiftSymbols</key>
<false/>
</dict>
</plist>

0 comments on commit e850466

Please sign in to comment.