Version 0.1 (2) #9
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: Release | |
on: | |
push: | |
paths: | |
- Configs/Deployment.xcconfig | |
jobs: | |
upload: | |
runs-on: macos-13 | |
environment: Release | |
env: | |
GITHUB_API_BASE_URL: https://api.github.com/repos/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up signing | |
run: | | |
echo "${{ secrets.CERTIFICATE }}" | base64 -d > "$RUNNER_TEMP/Certificate.p12" | |
security import "$RUNNER_TEMP/Certificate.p12" -P "${{ secrets.CERTIFICATE_PASSWORD }}" -A | |
- 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 -scheme macOS -archivePath macOS.xcarchive archive | |
- name: Archive visionOS | |
run: xcodebuild -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 -f -X POST \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${{ github.event.repository.owner.name }}/${{ github.event.repository.name }}/git/refs \ | |
-d "{'ref':'refs/tags/v$version','sha':'$commit'}" | |
curl -L -f -X POST \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
"$GITHUB_API_BASE_URL/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 |