Skip to content
Merged
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
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Publish release

on:
push:
branches:
- main
paths:
- Packaging/Info.plist
- .github/workflows/release.yml
workflow_dispatch:

permissions:
contents: write

jobs:
release:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- name: Select Xcode 16.4
run: sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer

- name: Read version
id: version
shell: bash
run: |
version=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' Packaging/Info.plist)
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid CFBundleShortVersionString: $version" >&2
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=v$version" >> "$GITHUB_OUTPUT"

- name: Build app
run: ./Packaging/build-app.sh

- name: Package app
shell: bash
run: |
asset=".build/package/NotchFlow-${{ steps.version.outputs.version }}.zip"
ditto -c -k --keepParent .build/package/NotchFlow.app "$asset"
shasum -a 256 "$asset" > "$asset.sha256"
echo "ASSET=$asset" >> "$GITHUB_ENV"

- name: Publish release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }}
shell: bash
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" "$ASSET" "$ASSET.sha256" --clobber
else
gh release create "$TAG" "$ASSET" "$ASSET.sha256" \
--target "$GITHUB_SHA" \
--title "NotchFlow $TAG" \
--generate-notes
fi
Loading