diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d112017 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore index 16411f0..a3349b5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ playground.xcworkspace build/ .claude/ +.DS_Store diff --git a/assets/dmg-background.png b/assets/dmg-background.png new file mode 100644 index 0000000..42c4c84 Binary files /dev/null and b/assets/dmg-background.png differ diff --git a/exportOptions.plist b/exportOptions.plist new file mode 100644 index 0000000..dca252f --- /dev/null +++ b/exportOptions.plist @@ -0,0 +1,10 @@ + + + + + method + mac-application + signingStyle + manual + + \ No newline at end of file