Skip to content

Commit e740647

Browse files
authored
Add macOS .app to releases (#13)
* Set up fastlane * Add release-macos workflow * for now * bundle install * Ruby versioning * Fix Ruby 3.4 * Maybe fix CI * Maybe unlock? * Update Release workflow * on push * tweaks * don’t use frozen * Trying something a lil different
1 parent 51cab9a commit e740647

File tree

7 files changed

+351
-6
lines changed

7 files changed

+351
-6
lines changed
Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
on:
22
workflow_dispatch:
3+
push:
34

45
jobs:
5-
build:
6+
build-linux:
67
strategy:
78
fail-fast: false
89
matrix:
@@ -21,13 +22,41 @@ jobs:
2122
run: |
2223
docker compose run --build --rm xtool -c "Linux/build.sh && mv Linux/packages/xtool{,-${{ matrix.host.arch }}}.AppImage"
2324
- name: Upload artifact
24-
id: upload_artifact
2525
uses: actions/upload-artifact@v4
2626
with:
2727
name: xtool-${{ matrix.host.arch }}
2828
path: Linux/packages/xtool-${{ matrix.host.arch }}.AppImage
29+
build-mac:
30+
runs-on: macos-15
31+
permissions:
32+
contents: write
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Setup Ruby
37+
uses: ruby/setup-ruby@v1
38+
with:
39+
working-directory: macOS
40+
bundler-cache: true
41+
- name: Build
42+
env:
43+
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
44+
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
45+
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
46+
IDENTITY_P12: ${{ secrets.IDENTITY_P12 }}
47+
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
48+
run: |
49+
cd macOS
50+
bundle exec fastlane package
51+
- name: Upload artifacts
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: xtool-mac
55+
path: |
56+
macOS/Build/Output/xtool.app.zip
57+
macOS/Build/Output/xtool.app.dSYM.zip
2958
release:
30-
needs: build
59+
needs: [build-linux, build-mac]
3160
runs-on: ubuntu-24.04
3261
permissions:
3362
contents: write
@@ -36,14 +65,12 @@ jobs:
3665
steps:
3766
- uses: actions/checkout@v4
3867
- name: Download artifact
39-
id: download_artifact
4068
uses: actions/download-artifact@v4
4169
with:
4270
pattern: xtool-*
4371
path: output
4472
- name: Create and publish release
45-
id: publish_release
4673
run: |
4774
TAG="${GITHUB_REF##*/}-${GITHUB_SHA:0:7}"
4875
gh release create "$TAG" --draft --title "Draft Release"
49-
gh release upload "$TAG" output/**/*.AppImage
76+
gh release upload "$TAG" output/**/*.{AppImage,app.zip,app.dSYM.zip}

macOS/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
/XToolMac.xcodeproj
22
Private*.xcconfig
3+
4+
/fastlane/README.md
5+
/fastlane/report.xml
6+
/Build
7+
/Private

macOS/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.4.3

macOS/Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'fastlane'
4+
gem 'fastlane-plugin-xcodegen'
5+
6+
# https://github.com/fastlane/fastlane/issues/29183#issuecomment-2567093826
7+
gem "abbrev"
8+
gem "mutex_m"
9+
gem "ostruct"

macOS/Gemfile.lock

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
abbrev (0.1.2)
9+
addressable (2.8.7)
10+
public_suffix (>= 2.0.2, < 7.0)
11+
artifactory (3.0.17)
12+
atomos (0.1.3)
13+
aws-eventstream (1.3.2)
14+
aws-partitions (1.1102.0)
15+
aws-sdk-core (3.223.0)
16+
aws-eventstream (~> 1, >= 1.3.0)
17+
aws-partitions (~> 1, >= 1.992.0)
18+
aws-sigv4 (~> 1.9)
19+
base64
20+
jmespath (~> 1, >= 1.6.1)
21+
logger
22+
aws-sdk-kms (1.100.0)
23+
aws-sdk-core (~> 3, >= 3.216.0)
24+
aws-sigv4 (~> 1.5)
25+
aws-sdk-s3 (1.185.0)
26+
aws-sdk-core (~> 3, >= 3.216.0)
27+
aws-sdk-kms (~> 1)
28+
aws-sigv4 (~> 1.5)
29+
aws-sigv4 (1.11.0)
30+
aws-eventstream (~> 1, >= 1.0.2)
31+
babosa (1.0.4)
32+
base64 (0.2.0)
33+
claide (1.1.0)
34+
colored (1.2)
35+
colored2 (3.1.2)
36+
commander (4.6.0)
37+
highline (~> 2.0.0)
38+
declarative (0.0.20)
39+
digest-crc (0.7.0)
40+
rake (>= 12.0.0, < 14.0.0)
41+
domain_name (0.6.20240107)
42+
dotenv (2.8.1)
43+
emoji_regex (3.2.3)
44+
excon (0.112.0)
45+
faraday (1.10.4)
46+
faraday-em_http (~> 1.0)
47+
faraday-em_synchrony (~> 1.0)
48+
faraday-excon (~> 1.1)
49+
faraday-httpclient (~> 1.0)
50+
faraday-multipart (~> 1.0)
51+
faraday-net_http (~> 1.0)
52+
faraday-net_http_persistent (~> 1.0)
53+
faraday-patron (~> 1.0)
54+
faraday-rack (~> 1.0)
55+
faraday-retry (~> 1.0)
56+
ruby2_keywords (>= 0.0.4)
57+
faraday-cookie_jar (0.0.7)
58+
faraday (>= 0.8.0)
59+
http-cookie (~> 1.0.0)
60+
faraday-em_http (1.0.0)
61+
faraday-em_synchrony (1.0.0)
62+
faraday-excon (1.1.0)
63+
faraday-httpclient (1.0.1)
64+
faraday-multipart (1.1.0)
65+
multipart-post (~> 2.0)
66+
faraday-net_http (1.0.2)
67+
faraday-net_http_persistent (1.2.0)
68+
faraday-patron (1.0.0)
69+
faraday-rack (1.0.0)
70+
faraday-retry (1.0.3)
71+
faraday_middleware (1.2.1)
72+
faraday (~> 1.0)
73+
fastimage (2.4.0)
74+
fastlane (2.227.2)
75+
CFPropertyList (>= 2.3, < 4.0.0)
76+
addressable (>= 2.8, < 3.0.0)
77+
artifactory (~> 3.0)
78+
aws-sdk-s3 (~> 1.0)
79+
babosa (>= 1.0.3, < 2.0.0)
80+
bundler (>= 1.12.0, < 3.0.0)
81+
colored (~> 1.2)
82+
commander (~> 4.6)
83+
dotenv (>= 2.1.1, < 3.0.0)
84+
emoji_regex (>= 0.1, < 4.0)
85+
excon (>= 0.71.0, < 1.0.0)
86+
faraday (~> 1.0)
87+
faraday-cookie_jar (~> 0.0.6)
88+
faraday_middleware (~> 1.0)
89+
fastimage (>= 2.1.0, < 3.0.0)
90+
fastlane-sirp (>= 1.0.0)
91+
gh_inspector (>= 1.1.2, < 2.0.0)
92+
google-apis-androidpublisher_v3 (~> 0.3)
93+
google-apis-playcustomapp_v1 (~> 0.1)
94+
google-cloud-env (>= 1.6.0, < 2.0.0)
95+
google-cloud-storage (~> 1.31)
96+
highline (~> 2.0)
97+
http-cookie (~> 1.0.5)
98+
json (< 3.0.0)
99+
jwt (>= 2.1.0, < 3)
100+
mini_magick (>= 4.9.4, < 5.0.0)
101+
multipart-post (>= 2.0.0, < 3.0.0)
102+
naturally (~> 2.2)
103+
optparse (>= 0.1.1, < 1.0.0)
104+
plist (>= 3.1.0, < 4.0.0)
105+
rubyzip (>= 2.0.0, < 3.0.0)
106+
security (= 0.1.5)
107+
simctl (~> 1.6.3)
108+
terminal-notifier (>= 2.0.0, < 3.0.0)
109+
terminal-table (~> 3)
110+
tty-screen (>= 0.6.3, < 1.0.0)
111+
tty-spinner (>= 0.8.0, < 1.0.0)
112+
word_wrap (~> 1.0.0)
113+
xcodeproj (>= 1.13.0, < 2.0.0)
114+
xcpretty (~> 0.4.1)
115+
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
116+
fastlane-plugin-brew (0.1.1)
117+
fastlane-plugin-xcodegen (1.1.0)
118+
fastlane-plugin-brew (~> 0.1.1)
119+
fastlane-sirp (1.0.0)
120+
sysrandom (~> 1.0)
121+
gh_inspector (1.1.3)
122+
google-apis-androidpublisher_v3 (0.54.0)
123+
google-apis-core (>= 0.11.0, < 2.a)
124+
google-apis-core (0.11.3)
125+
addressable (~> 2.5, >= 2.5.1)
126+
googleauth (>= 0.16.2, < 2.a)
127+
httpclient (>= 2.8.1, < 3.a)
128+
mini_mime (~> 1.0)
129+
representable (~> 3.0)
130+
retriable (>= 2.0, < 4.a)
131+
rexml
132+
google-apis-iamcredentials_v1 (0.17.0)
133+
google-apis-core (>= 0.11.0, < 2.a)
134+
google-apis-playcustomapp_v1 (0.13.0)
135+
google-apis-core (>= 0.11.0, < 2.a)
136+
google-apis-storage_v1 (0.31.0)
137+
google-apis-core (>= 0.11.0, < 2.a)
138+
google-cloud-core (1.8.0)
139+
google-cloud-env (>= 1.0, < 3.a)
140+
google-cloud-errors (~> 1.0)
141+
google-cloud-env (1.6.0)
142+
faraday (>= 0.17.3, < 3.0)
143+
google-cloud-errors (1.5.0)
144+
google-cloud-storage (1.47.0)
145+
addressable (~> 2.8)
146+
digest-crc (~> 0.4)
147+
google-apis-iamcredentials_v1 (~> 0.1)
148+
google-apis-storage_v1 (~> 0.31.0)
149+
google-cloud-core (~> 1.6)
150+
googleauth (>= 0.16.2, < 2.a)
151+
mini_mime (~> 1.0)
152+
googleauth (1.8.1)
153+
faraday (>= 0.17.3, < 3.a)
154+
jwt (>= 1.4, < 3.0)
155+
multi_json (~> 1.11)
156+
os (>= 0.9, < 2.0)
157+
signet (>= 0.16, < 2.a)
158+
highline (2.0.3)
159+
http-cookie (1.0.8)
160+
domain_name (~> 0.5)
161+
httpclient (2.9.0)
162+
mutex_m
163+
jmespath (1.6.2)
164+
json (2.11.3)
165+
jwt (2.10.1)
166+
base64
167+
logger (1.7.0)
168+
mini_magick (4.13.2)
169+
mini_mime (1.1.5)
170+
multi_json (1.15.0)
171+
multipart-post (2.4.1)
172+
mutex_m (0.3.0)
173+
nanaimo (0.4.0)
174+
naturally (2.2.1)
175+
nkf (0.2.0)
176+
optparse (0.6.0)
177+
os (1.1.4)
178+
ostruct (0.6.1)
179+
plist (3.7.2)
180+
public_suffix (6.0.2)
181+
rake (13.2.1)
182+
representable (3.2.0)
183+
declarative (< 0.1.0)
184+
trailblazer-option (>= 0.1.1, < 0.2.0)
185+
uber (< 0.2.0)
186+
retriable (3.1.2)
187+
rexml (3.4.1)
188+
rouge (3.28.0)
189+
ruby2_keywords (0.0.5)
190+
rubyzip (2.4.1)
191+
security (0.1.5)
192+
signet (0.20.0)
193+
addressable (~> 2.8)
194+
faraday (>= 0.17.5, < 3.a)
195+
jwt (>= 1.5, < 3.0)
196+
multi_json (~> 1.10)
197+
simctl (1.6.10)
198+
CFPropertyList
199+
naturally
200+
sysrandom (1.0.5)
201+
terminal-notifier (2.0.0)
202+
terminal-table (3.0.2)
203+
unicode-display_width (>= 1.1.1, < 3)
204+
trailblazer-option (0.1.2)
205+
tty-cursor (0.7.1)
206+
tty-screen (0.8.2)
207+
tty-spinner (0.9.3)
208+
tty-cursor (~> 0.7)
209+
uber (0.1.0)
210+
unicode-display_width (2.6.0)
211+
word_wrap (1.0.0)
212+
xcodeproj (1.27.0)
213+
CFPropertyList (>= 2.3.3, < 4.0)
214+
atomos (~> 0.1.3)
215+
claide (>= 1.0.2, < 2.0)
216+
colored2 (~> 3.1)
217+
nanaimo (~> 0.4.0)
218+
rexml (>= 3.3.6, < 4.0)
219+
xcpretty (0.4.1)
220+
rouge (~> 3.28.0)
221+
xcpretty-travis-formatter (1.0.1)
222+
xcpretty (~> 0.2, >= 0.0.7)
223+
224+
PLATFORMS
225+
arm64-darwin-24
226+
ruby
227+
228+
DEPENDENCIES
229+
abbrev
230+
fastlane
231+
fastlane-plugin-xcodegen
232+
mutex_m
233+
ostruct
234+
235+
BUNDLED WITH
236+
2.6.7

macOS/fastlane/Appfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app_identifier("sh.xtool.XToolMac")

macOS/fastlane/Fastfile

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
default_platform(:mac)
2+
3+
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
4+
5+
lane :package do
6+
xcodegen
7+
8+
# Config is controlled via env vars
9+
app_store_connect_api_key(
10+
is_key_content_base64: true,
11+
)
12+
13+
create_keychain(
14+
name: "xtool.keychain",
15+
password: "",
16+
unlock: true,
17+
)
18+
19+
unlock_keychain(
20+
path: "xtool.keychain",
21+
password: "",
22+
)
23+
24+
Tempfile.create(["Identity", ".p12"]) do |file|
25+
file.write(Base64.decode64(ENV["IDENTITY_P12"]))
26+
file.close
27+
import_certificate(
28+
certificate_path: file.path,
29+
keychain_name: "xtool.keychain",
30+
keychain_password: "",
31+
)
32+
end
33+
34+
sigh(
35+
platform: "macos",
36+
output_path: "./Build/Signing",
37+
force: true,
38+
developer_id: true,
39+
)
40+
41+
update_code_signing_settings(
42+
use_automatic_signing: false,
43+
team_id: ENV["DEVELOPMENT_TEAM"],
44+
code_sign_identity: "Developer ID Application",
45+
profile_name: lane_context[SharedValues::SIGH_NAME],
46+
)
47+
48+
gym(
49+
export_method: "developer-id",
50+
output_directory: "./Build/Output",
51+
)
52+
53+
notarize(
54+
package: "./Build/Output/xtool.app",
55+
)
56+
57+
# we need to re-package after notarization and stapling.
58+
# we have to use `ditto --sequesterRsrc` rather than zip
59+
# because the default strategy stores resource forks as
60+
# ._Foo but codesigning doesn't like that, and instead
61+
# wants them in __MACOSX.
62+
sh(
63+
"ditto", "-c", "-k", "--keepParent", "--sequesterRsrc",
64+
"../Build/Output/xtool.app", "../Build/Output/xtool.app.zip",
65+
)
66+
end

0 commit comments

Comments
 (0)