Skip to content

Commit 6cbe1a0

Browse files
Support beta releases
1 parent 59c0904 commit 6cbe1a0

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ jobs:
2323
TAG: ${{ github.ref_name }}
2424
run: |
2525
APP_VERSION=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' scripts/AppBundleInfo.plist)
26-
test "$TAG" = "v$APP_VERSION"
26+
case "$TAG" in
27+
"v$APP_VERSION"|"v$APP_VERSION-beta."*) ;;
28+
*)
29+
echo "Tag $TAG must match v$APP_VERSION or v$APP_VERSION-beta.N"
30+
exit 1
31+
;;
32+
esac
2733
2834
- name: Run tests
2935
run: swift test
@@ -37,10 +43,15 @@ jobs:
3743
GH_TOKEN: ${{ github.token }}
3844
TAG: ${{ github.ref_name }}
3945
run: |
46+
PRERELEASE=()
47+
if [[ "$TAG" == *-beta.* ]]; then
48+
PRERELEASE=(--prerelease)
49+
fi
4050
gh release create "$TAG" \
4151
.build/release-package/Sajilo-macos-arm64.dmg \
4252
.build/release-package/Sajilo-macos-arm64.zip \
4353
--title "Sajilo ${TAG#v}" \
54+
"${PRERELEASE[@]}" \
4455
--generate-notes
4556
4657
- name: Upload release archive

RELEASING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ GitHub Actions builds and publishes the Mac download for you.
99
3. Change `CFBundleVersion` to a higher number each release.
1010
4. Commit and push your changes to GitHub.
1111

12-
## Publish a release
12+
## Publish a beta
1313

14-
Create and push a tag matching the version:
14+
For the first beta of version `0.1.0`, create and push this tag:
1515

1616
```bash
17-
git tag -a v0.1.0 -m "Sajilo 0.1.0"
18-
git push origin v0.1.0
17+
git tag -a v0.1.0-beta.1 -m "Sajilo 0.1.0 beta 1"
18+
git push origin v0.1.0-beta.1
1919
```
2020

21-
GitHub Actions will test the app, create the DMG and ZIP, and publish a GitHub Release. When it finishes, this link downloads the newest Mac version:
21+
GitHub Actions will test the app, create the DMG and ZIP, then publish a GitHub prerelease. For a stable release, use the matching tag without `-beta.1`, for example `v0.1.0`.
22+
23+
The latest stable release is available at:
2224

2325
`https://github.com/adarshaacharya/sajilo/releases/latest/download/Sajilo-macos-arm64.dmg`
2426

0 commit comments

Comments
 (0)