-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflows] Add workflow to create a draft release with artifacts
- Loading branch information
1 parent
3775830
commit 3c87411
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Based on | ||
# https://github.com/theos/sdks/blob/ca52092/.github/workflows/release.yml | ||
# Also help from | ||
# https://github.com/NightwindDev/Tweak-Tutorial/blob/d39b124/oldabi.md#compiling-via-github-actions | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
runs-on: macos-14 | ||
env: | ||
THEOS: theos | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Checkout theos/theos | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: theos/theos | ||
submodules: recursive | ||
path: ${{ env.THEOS }} | ||
|
||
- name: Install package depenencies | ||
run: | | ||
brew install make xz ldid | ||
- name: Build iOS package (default) | ||
run: | | ||
gmake clean package FINALPACKAGE=1 | ||
- name: Build iOS package (rootless) | ||
run: | | ||
gmake clean package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | ||
- name: Build macOS binary (default) | ||
run: | | ||
xcodebuild -workspace .swiftpm/xcode/package.xcworkspace \ | ||
-scheme classdumpctl \ | ||
-config Release \ | ||
-destination 'generic/platform=macOS' \ | ||
-derivedDataPath XcodeDerivedData \ | ||
-quiet | ||
mv XcodeDerivedData/Build/Products/Release/classdumpctl classdumpctl-mac | ||
- name: Build macOS binary (Mac Catalyst) | ||
run: | | ||
# I don't know how to build for Mac Catalyst without using Xcode. | ||
# the triple 'arm64-apple-ios-macabi' errors out when | ||
# swift-build transforms and passes the value to clang | ||
# clang: error: invalid version number in '-target arm64-apple-ios13.0-macabi' | ||
xcodebuild -workspace .swiftpm/xcode/package.xcworkspace \ | ||
-scheme classdumpctl \ | ||
-config Release \ | ||
-destination 'generic/platform=macOS,variant=Mac Catalyst' \ | ||
-derivedDataPath XcodeDerivedData \ | ||
-quiet | ||
mv XcodeDerivedData/Build/Products/Release-maccatalyst/classdumpctl classdumpctl-maccatalyst | ||
- name: Publish release | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
TAG="auto-${GITHUB_SHA:0:7}" | ||
gh release create "${TAG}" --draft \ | ||
--title "Automatic Release" \ | ||
--target "${GITHUB_SHA}" \ | ||
packages/*.deb classdumpctl-mac classdumpctl-maccatalyst |