Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build and Release

on:
push:
tags:
- 'v*' # Triggers on semantic versioning tags, e.g., v1.0.0

jobs:
release:
name: Build DMG
runs-on: macos-latest
permissions:
contents: write # Needed to push release

steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Build and Archive
run: |
xcodebuild archive \
-project stasis.xcodeproj \
-scheme "stasis-release" \
-configuration Release \
-archivePath $PWD/build/Stasis.xcarchive \
CODE_SIGN_IDENTITY="-" \
CODE_SIGNING_REQUIRED=YES \
CODE_SIGNING_ALLOWED=YES

- name: Export Archive
run: |
xcodebuild -exportArchive \
-archivePath $PWD/build/Stasis.xcarchive \
-exportPath $PWD/build/export \
-exportOptionsPlist exportOptions.plist

- name: Install Tools
run: brew install create-dmg fileicon

- name: Create DMG
run: |
cd build/export
mkdir -p dmg_root
cp -R "Stasis.app" dmg_root/
codesign --force --deep --sign - "dmg_root/Stasis.app"
create-dmg \
--volname "Stasis" \
--volicon "Stasis.app/Contents/Resources/AppIcon.icns" \
--window-pos 340 200 \
--window-size 600 400 \
--icon-size 100 \
--background "../../assets/dmg-background.png" \
--icon "Stasis.app" 123 210 \
--hide-extension "Stasis.app" \
--app-drop-link 430 220 \
"../../Stasis.dmg" \
"dmg_root"

# Set the custom icon on the DMG file itself
fileicon set "../../Stasis.dmg" "Stasis.app/Contents/Resources/AppIcon.icns"

- name: Release to GitHub
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
Stasis.dmg
token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ playground.xcworkspace

build/
.claude/
.DS_Store
Binary file added assets/dmg-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions exportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>mac-application</string>
<key>signingStyle</key>
<string>manual</string>
</dict>
</plist>