Skip to content

Commit 6835c5f

Browse files
committed
[workflows] Add workflow to create a draft release with artifacts
1 parent 54f3224 commit 6835c5f

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

.github/workflows/release.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Based on
2+
# https://github.com/theos/sdks/blob/ca52092/.github/workflows/release.yml
3+
# Also help from
4+
# https://github.com/NightwindDev/Tweak-Tutorial/blob/d39b124/oldabi.md#compiling-via-github-actions
5+
name: Release
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
release:
14+
# needed to be able to create a Release
15+
permissions:
16+
contents: write
17+
runs-on: macos-14
18+
env:
19+
THEOS: theos
20+
steps:
21+
- name: Checkout repo
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: recursive
25+
26+
- name: Checkout theos/theos
27+
uses: actions/checkout@v4
28+
with:
29+
repository: theos/theos
30+
submodules: recursive
31+
path: ${{ env.THEOS }}
32+
33+
- name: Install package depenencies
34+
run: |
35+
brew install make xz ldid
36+
37+
- name: Build iOS package (default)
38+
run: |
39+
gmake clean package FINALPACKAGE=1
40+
41+
- name: Build iOS package (rootless)
42+
run: |
43+
gmake clean package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless
44+
45+
- name: Build macOS binary (default)
46+
run: |
47+
xcodebuild -workspace .swiftpm/xcode/package.xcworkspace \
48+
-scheme classdumpctl \
49+
-config Release \
50+
-destination 'generic/platform=macOS' \
51+
-derivedDataPath XcodeDerivedData \
52+
-quiet
53+
mv XcodeDerivedData/Build/Products/Release/classdumpctl classdumpctl-mac
54+
55+
- name: Build macOS binary (Mac Catalyst)
56+
run: |
57+
# I don't know how to build for Mac Catalyst without using Xcode.
58+
# the triple 'arm64-apple-ios-macabi' errors out when
59+
# swift-build transforms and passes the value to clang
60+
# clang: error: invalid version number in '-target arm64-apple-ios13.0-macabi'
61+
xcodebuild -workspace .swiftpm/xcode/package.xcworkspace \
62+
-scheme classdumpctl \
63+
-config Release \
64+
-destination 'generic/platform=macOS,variant=Mac Catalyst' \
65+
-derivedDataPath XcodeDerivedData \
66+
-quiet
67+
mv XcodeDerivedData/Build/Products/Release-maccatalyst/classdumpctl classdumpctl-maccatalyst
68+
69+
- name: Publish release
70+
env:
71+
GH_TOKEN: ${{ github.token }}
72+
run: |
73+
TAG="auto-${GITHUB_SHA:0:7}"
74+
gh release create "${TAG}" --draft \
75+
--title "Automatic Release" \
76+
--target "${GITHUB_SHA}" \
77+
packages/*.deb classdumpctl-mac classdumpctl-maccatalyst

0 commit comments

Comments
 (0)