@@ -13,13 +13,13 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
needs : [build-macos]
15
15
steps :
16
- - uses : actions/checkout@v4
17
- - name : Tip Tag
18
- run : |
19
- git config user.name "GitHub Actions Bot"
20
- git config user.email "<>"
21
- git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA}
22
- git push --force origin tip
16
+ - uses : actions/checkout@v4
17
+ - name : Tip Tag
18
+ run : |
19
+ git config user.name "GitHub Actions Bot"
20
+ git config user.email "<>"
21
+ git tag -fa tip -m "Latest Continuous Release" ${GITHUB_SHA}
22
+ git push --force origin tip
23
23
24
24
build-macos :
25
25
if : ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
@@ -29,130 +29,130 @@ jobs:
29
29
# Needed for macos SDK
30
30
AGREE : " true"
31
31
steps :
32
- - name : Checkout code
33
- uses : actions/checkout@v4
34
- with :
35
- submodules : recursive
36
- fetch-depth : 0
37
-
38
- # Install Nix and use that to run our tests so our environment matches exactly.
39
- - uses : cachix/install-nix-action@v23
40
- with :
41
- nix_path : nixpkgs=channel:nixos-unstable
42
-
43
- # Setup our S3 client
44
- - name : Setup s3cmd
45
- uses : s3-actions/s3cmd@v1.5.0
46
- with :
47
- provider : cloudflare
48
- account_id : ${{ secrets.CF_R2_TIP_ACCOUNT_ID }}
49
- access_key : ${{ secrets.CF_R2_TIP_AWS_KEY }}
50
- secreT_key : ${{ secrets.CF_R2_TIP_SECRET_KEY }}
51
-
52
- # Load Build Number
53
- - name : Build Number
54
- run : |
55
- echo "GHOSTTY_BUILD=$(git rev-list --count head)" >> $GITHUB_ENV
56
-
57
- # GhosttyKit is the framework that is built from Zig for our native
58
- # Mac app to access. Build this in release mode.
59
- - name : Build GhosttyKit
60
- run : nix develop -c zig build -Dstatic=true -Doptimize=ReleaseFast
61
-
62
- # The native app is built with native XCode tooling. This also does
63
- # codesigning. IMPORTANT: this must NOT run in a Nix environment.
64
- # Nix breaks xcodebuild so this has to be run outside.
65
- - name : Build Ghostty.app
66
- run : cd macos && xcodebuild -configuration Release
67
-
68
- # We inject the "build number" as simply the number of commits since HEAD.
69
- # This will be a monotonically always increasing build number that we use.
70
- - name : Inject Build Number
71
- run : |
72
- echo "Setting build to $GHOSTTY_BUILD"
73
- /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GHOSTTY_BUILD" "macos/build/Release/Ghostty.app/Contents/Info.plist"
74
-
75
- - name : Zip Unsigned App
76
- run : nix develop -c sh -c 'cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal-unsigned.zip Ghostty.app'
77
-
78
- # Update Release
79
- - name : Release Unsigned
80
- uses : softprops/action-gh-release@v1
81
- with :
82
- name : " Ghostty Tip (\ " Nightly\" ) "
83
- prerelease : true
84
- tag_name : tip
85
- target_commitish : ${{ github.sha }}
86
- files : ghostty-macos-universal-unsigned.zip
87
- token : ${{ secrets.GH_RELEASE_TOKEN }}
88
-
89
- - name : Codesign app bundle
90
- env :
91
- MACOS_CERTIFICATE : ${{ secrets.PROD_MACOS_CERTIFICATE }}
92
- MACOS_CERTIFICATE_PWD : ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
93
- MACOS_CERTIFICATE_NAME : ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
94
- MACOS_CI_KEYCHAIN_PWD : ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
95
- run : |
96
- # Turn our base64-encoded certificate back to a regular .p12 file
97
- echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
98
-
99
- # We need to create a new keychain, otherwise using the certificate will prompt
100
- # with a UI dialog asking for the certificate password, which we can't
101
- # use in a headless CI environment
102
- security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
103
- security default-keychain -s build.keychain
104
- security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
105
- security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
106
- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
107
-
108
- # We finally codesign our app bundle, specifying the Hardened runtime option
109
- /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime macos/build/Release/Ghostty.app -v
110
-
111
- - name : " Notarize app bundle"
112
- env :
113
- PROD_MACOS_NOTARIZATION_APPLE_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
114
- PROD_MACOS_NOTARIZATION_TEAM_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
115
- PROD_MACOS_NOTARIZATION_PWD : ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
116
- run : |
117
- # Store the notarization credentials so that we can prevent a UI password dialog
118
- # from blocking the CI
119
- echo "Create keychain profile"
120
- xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
121
-
122
- # We can't notarize an app bundle directly, but we need to compress it as an archive.
123
- # Therefore, we create a zip file containing our app bundle, so that we can send it to the
124
- # notarization service
125
- echo "Creating temp notarization archive"
126
- ditto -c -k --keepParent "macos/build/Release/Ghostty.app" "notarization.zip"
127
-
128
- # Here we send the notarization request to the Apple's Notarization service, waiting for the result.
129
- # This typically takes a few seconds inside a CI environment, but it might take more depending on the App
130
- # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
131
- # you're curious
132
- echo "Notarize app"
133
- xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
134
-
135
- # Finally, we need to "attach the staple" to our executable, which will allow our app to be
136
- # validated by macOS even when an internet connection is not available.
137
- echo "Attach staple"
138
- xcrun stapler staple "macos/build/Release/Ghostty.app"
139
-
140
- # Zip up the app
141
- - name : Zip App
142
- run : cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal.zip Ghostty.app
143
-
144
- # Update Release
145
- - name : Release
146
- uses : softprops/action-gh-release@v1
147
- with :
148
- name : " Ghostty Tip (\ " Nightly\" ) "
149
- prerelease : true
150
- tag_name : tip
151
- target_commitish : ${{ github.sha }}
152
- files : ghostty-macos-universal.zip
153
- token : ${{ secrets.GH_RELEASE_TOKEN }}
154
-
155
- # Update Blob Storage
156
- - name : Upload to Blob Storage
157
- run : |
158
- s3cmd put ghostty-macos-universal.zip s3://ghostty-tip/${GHOSTTY_BUILD}/ghostty-macos-universal.zip
32
+ - name : Checkout code
33
+ uses : actions/checkout@v4
34
+ with :
35
+ submodules : recursive
36
+ fetch-depth : 0
37
+
38
+ # Install Nix and use that to run our tests so our environment matches exactly.
39
+ - uses : cachix/install-nix-action@v23
40
+ with :
41
+ nix_path : nixpkgs=channel:nixos-unstable
42
+
43
+ # Setup our S3 client
44
+ - name : Setup s3cmd
45
+ uses : s3-actions/s3cmd@v1.5.0
46
+ with :
47
+ provider : cloudflare
48
+ account_id : ${{ secrets.CF_R2_TIP_ACCOUNT_ID }}
49
+ access_key : ${{ secrets.CF_R2_TIP_AWS_KEY }}
50
+ secreT_key : ${{ secrets.CF_R2_TIP_SECRET_KEY }}
51
+
52
+ # Load Build Number
53
+ - name : Build Number
54
+ run : |
55
+ echo "GHOSTTY_BUILD=$(git rev-list --count head)" >> $GITHUB_ENV
56
+
57
+ # GhosttyKit is the framework that is built from Zig for our native
58
+ # Mac app to access. Build this in release mode.
59
+ - name : Build GhosttyKit
60
+ run : nix develop -c zig build -Dstatic=true -Doptimize=ReleaseFast
61
+
62
+ # The native app is built with native XCode tooling. This also does
63
+ # codesigning. IMPORTANT: this must NOT run in a Nix environment.
64
+ # Nix breaks xcodebuild so this has to be run outside.
65
+ - name : Build Ghostty.app
66
+ run : cd macos && xcodebuild -configuration Release
67
+
68
+ # We inject the "build number" as simply the number of commits since HEAD.
69
+ # This will be a monotonically always increasing build number that we use.
70
+ - name : Inject Build Number
71
+ run : |
72
+ echo "Setting build to $GHOSTTY_BUILD"
73
+ /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GHOSTTY_BUILD" "macos/build/Release/Ghostty.app/Contents/Info.plist"
74
+
75
+ - name : Zip Unsigned App
76
+ run : nix develop -c sh -c 'cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal-unsigned.zip Ghostty.app'
77
+
78
+ # Update Release
79
+ - name : Release Unsigned
80
+ uses : softprops/action-gh-release@v1
81
+ with :
82
+ name : ' Ghostty Tip ("Nightly") '
83
+ prerelease : true
84
+ tag_name : tip
85
+ target_commitish : ${{ github.sha }}
86
+ files : ghostty-macos-universal-unsigned.zip
87
+ token : ${{ secrets.GH_RELEASE_TOKEN }}
88
+
89
+ - name : Codesign app bundle
90
+ env :
91
+ MACOS_CERTIFICATE : ${{ secrets.PROD_MACOS_CERTIFICATE }}
92
+ MACOS_CERTIFICATE_PWD : ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
93
+ MACOS_CERTIFICATE_NAME : ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
94
+ MACOS_CI_KEYCHAIN_PWD : ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
95
+ run : |
96
+ # Turn our base64-encoded certificate back to a regular .p12 file
97
+ echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
98
+
99
+ # We need to create a new keychain, otherwise using the certificate will prompt
100
+ # with a UI dialog asking for the certificate password, which we can't
101
+ # use in a headless CI environment
102
+ security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
103
+ security default-keychain -s build.keychain
104
+ security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
105
+ security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
106
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
107
+
108
+ # We finally codesign our app bundle, specifying the Hardened runtime option
109
+ /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" --options runtime macos/build/Release/Ghostty.app -v
110
+
111
+ - name : " Notarize app bundle"
112
+ env :
113
+ PROD_MACOS_NOTARIZATION_APPLE_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
114
+ PROD_MACOS_NOTARIZATION_TEAM_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
115
+ PROD_MACOS_NOTARIZATION_PWD : ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
116
+ run : |
117
+ # Store the notarization credentials so that we can prevent a UI password dialog
118
+ # from blocking the CI
119
+ echo "Create keychain profile"
120
+ xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
121
+
122
+ # We can't notarize an app bundle directly, but we need to compress it as an archive.
123
+ # Therefore, we create a zip file containing our app bundle, so that we can send it to the
124
+ # notarization service
125
+ echo "Creating temp notarization archive"
126
+ ditto -c -k --keepParent "macos/build/Release/Ghostty.app" "notarization.zip"
127
+
128
+ # Here we send the notarization request to the Apple's Notarization service, waiting for the result.
129
+ # This typically takes a few seconds inside a CI environment, but it might take more depending on the App
130
+ # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
131
+ # you're curious
132
+ echo "Notarize app"
133
+ xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
134
+
135
+ # Finally, we need to "attach the staple" to our executable, which will allow our app to be
136
+ # validated by macOS even when an internet connection is not available.
137
+ echo "Attach staple"
138
+ xcrun stapler staple "macos/build/Release/Ghostty.app"
139
+
140
+ # Zip up the app
141
+ - name : Zip App
142
+ run : cd macos/build/Release && zip -9 -r --symlinks ../../../ghostty-macos-universal.zip Ghostty.app
143
+
144
+ # Update Release
145
+ - name : Release
146
+ uses : softprops/action-gh-release@v1
147
+ with :
148
+ name : ' Ghostty Tip ("Nightly") '
149
+ prerelease : true
150
+ tag_name : tip
151
+ target_commitish : ${{ github.sha }}
152
+ files : ghostty-macos-universal.zip
153
+ token : ${{ secrets.GH_RELEASE_TOKEN }}
154
+
155
+ # Update Blob Storage
156
+ - name : Upload to Blob Storage
157
+ run : |
158
+ s3cmd put ghostty-macos-universal.zip s3://ghostty-tip/${GHOSTTY_BUILD}/ghostty-macos-universal.zip
0 commit comments