Skip to content

Commit

Permalink
ci: release workflows build a dmg for macOS
Browse files Browse the repository at this point in the history
We've used a zip for the duration of the private beta but macOS users
expect a dmg. This commit changes both of our release workflows to begin
building a dmg instead of a zip.
  • Loading branch information
mitchellh committed Dec 21, 2024
1 parent d3de22c commit 6787cb1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ jobs:
- name: XCode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app

- name: Setup create-dmg
env:
CREATE_DMG_VERSION: 1.2.2
run: |
curl -L https://github.com/create-dmg/create-dmg/archive/refs/tags/v${CREATE_DMG_VERSION}.tar.gz > create-dmg.tar.gz
tar -xzf create-dmg.tar.gz
mv create-dmg-${CREATE_DMG_VERSION} create-dmg
./create-dmg/create-dmg --version
- name: Setup Sparkle
env:
SPARKLE_VERSION: 2.6.3
Expand Down Expand Up @@ -199,8 +208,9 @@ jobs:
# Codesign the app bundle
/usr/bin/codesign --verbose -f -s "$MACOS_CERTIFICATE_NAME" -o runtime --entitlements "macos/Ghostty.entitlements" macos/build/Release/Ghostty.app
- name: "Notarize app bundle"
- name: Create DMG
env:
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
Expand All @@ -210,22 +220,21 @@ jobs:
echo "Create keychain profile"
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"
# We can't notarize an app bundle directly, but we need to compress it as an archive.
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service
echo "Creating temp notarization archive"
ditto -c -k --keepParent "macos/build/Release/Ghostty.app" "notarization.zip"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize app"
xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
# Setup our source directory
mkdir create-dmg-src/
cp -r macos/build/Release/Ghostty.app create-dmg-src/
# Create the DMG, which will also codesign and notarize
./create-dmg/create-dmg \
--volname Ghostty \
--window-size 800 450 \
--icon-size 140 \
--icon "Ghostty.app" 200 200 \
--hide-extension "Ghostty.app" \
--app-drop-link 600 200 \
Ghostty.dmg create-dmg-src/
# Staple our app bundle too for the zip
xcrun stapler staple "macos/build/Release/Ghostty.app"
# Zip up the app and symbols
Expand All @@ -240,6 +249,7 @@ jobs:
with:
name: macos
path: |-
Ghostty.dmg
ghostty-macos-universal.zip
ghostty-macos-universal-dsym.zip
Expand Down
39 changes: 39 additions & 0 deletions appcast.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version='1.0' encoding='utf-8'?>
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>Ghostty</title>
<item><title>Build 8343</title><pubDate>Fri, 20 Dec 2024 21:34:26 +0000</pubDate><sparkle:version>8343</sparkle:version><sparkle:shortVersionString>0abd4ea8 (2024-12-20)</sparkle:shortVersionString><sparkle:minimumSystemVersion>13.0.0</sparkle:minimumSystemVersion><description>
&lt;h1&gt;Ghostty v&lt;Element '{http://www.andymatuschak.org/xml-namespaces/sparkle}version' at 0x104f7d120&gt;&lt;/h1&gt;
&lt;p&gt;
We don't currently generate release notes for auto-updates.
You can view the complete changelog and release notes on
the &lt;a href="https://ghostty.org"&gt;Ghostty website&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This release was built from commit &lt;code&gt;&lt;a href="https://github.com/ghostty-org/ghostty/commits/0abd4ea8a22b194daf79c812aa154c7c4abe3caa"&gt;0abd4ea8&lt;/a&gt;&lt;/code&gt;
on 2024-12-20.
&lt;/p&gt;
</description><enclosure url="https://release.files.ghostty.org/&lt;Element '{http://www.andymatuschak.org/xml-namespaces/sparkle}version' at 0x104f7d120&gt;/ghostty-macos-universal.zip" type="application/octet-stream" sparkle:edSignature="UCdy3LSP+udlRloMLWYOrB0IcZjRXol/ElXFTOyb/4+1hfg+mQmbPysuyy60S+zkzY7SWoQdNAm62T9tfpR6BA==" length="20708162" /></item><item><title>Build 8346</title><pubDate>Fri, 20 Dec 2024 22:38:00 +0000</pubDate><sparkle:version>8346</sparkle:version><sparkle:shortVersionString>663205b5 (2024-12-20)</sparkle:shortVersionString><sparkle:minimumSystemVersion>13.0.0</sparkle:minimumSystemVersion><description>
&lt;h1&gt;Ghostty v0.1.4&lt;/h1&gt;
&lt;p&gt;
We don't currently generate release notes for auto-updates.
You can view the complete changelog and release notes on
the &lt;a href="https://ghostty.org"&gt;Ghostty website&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This release was built from commit &lt;code&gt;&lt;a href="https://github.com/ghostty-org/ghostty/commits/663205b5097506f5dc0ac5cd9aa32feb5aec8732"&gt;663205b5&lt;/a&gt;&lt;/code&gt;
on 2024-12-20.
&lt;/p&gt;
</description><enclosure url="https://release.files.ghostty.org/0.1.4/ghostty-macos-universal.zip" type="application/octet-stream" sparkle:edSignature="C1+WtXy9UfHqMjRQfWbntXnRjudh8d0vZ04TbbGkKnyfK4RHFEEkxU5XsmaLLFaNfoBglLeuRkj/UtxElvz7AA==" length="20711303" /></item><item><title>Build 8347</title><pubDate>Fri, 20 Dec 2024 22:52:12 +0000</pubDate><sparkle:version>8347</sparkle:version><sparkle:shortVersionString>0.1.5</sparkle:shortVersionString><sparkle:minimumSystemVersion>13.0.0</sparkle:minimumSystemVersion><description>
&lt;h1&gt;Ghostty v0.1.5&lt;/h1&gt;
&lt;p&gt;
This release was built from commit &lt;code&gt;&lt;a href="https://github.com/ghostty-org/ghostty/commits/d3de22ce284638e6b5f3a1ac7a6522e684428d88"&gt;d3de22ce&lt;/a&gt;&lt;/code&gt;
on 2024-12-20.
&lt;/p&gt;
&lt;p&gt;
We don't currently generate release notes for auto-updates.
You can view the complete changelog and release notes on
the &lt;a href="https://ghostty.org"&gt;Ghostty website&lt;/a&gt;.
&lt;/p&gt;
</description><enclosure url="https://release.files.ghostty.org/0.1.5/ghostty-macos-universal.zip" type="application/octet-stream" sparkle:edSignature="apF0FrVfq7aBBL9hiuuwwiXF5Tyx2602ABpCIiKzblLMiTomeQ3BjaRXYwO6iotWgB9ug1wbbpP3cYHSXKi5BQ==" length="20710970" /></item></channel>
</rss>

0 comments on commit 6787cb1

Please sign in to comment.