Skip to content

Commit fc16e9c

Browse files
authored
ci: support prerelease macOS builds
1 parent 5d1d4ad commit fc16e9c

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
# Allow manual trigger
1111
workflow_dispatch:
1212

13+
env:
14+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
15+
1316
jobs:
1417
build:
1518
name: Build

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ jobs:
2222
artifact-name: devtoolbox-macos-release-${{ github.run_id }}
2323
go-version-file: go.mod
2424
runner-label: macos-26
25+
github-release-prerelease: ${{ contains(github.ref_name, '-') }}
2526
secrets: inherit

docs/MACOS_RELEASE.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ This project ships macOS releases as a signed, notarized, and stapled
66
The first signed release is intentionally macOS-only. Linux and Windows release
77
artifacts are skipped until a later release pass.
88

9-
Release tags use the normal stable project SemVer format, for example `v0.10.0`.
10-
The packaging script embeds the tag version into the macOS app bundle as
11-
`CFBundleShortVersionString` and `CFBundleVersion`.
9+
Release tags use normal project SemVer. Stable releases use tags such as
10+
`v0.10.0`; prereleases use tags such as `v0.10.0-rc.1`. The packaging script
11+
embeds the stable base version into the macOS app bundle as
12+
`CFBundleShortVersionString` and `CFBundleVersion`, so a prerelease tag like
13+
`v0.10.0-rc.1` embeds `0.10.0` in the app bundle and marks the GitHub Release
14+
as a prerelease.
1215

1316
## Required GitHub Secrets
1417

scripts/package-macos-universal.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@ set -euo pipefail
44
app_name="${APP_NAME:-DevToolbox}"
55
bin_dir="${BIN_DIR:-bin}"
66
app_version="${APP_VERSION:-}"
7+
tag_version=""
78

8-
if [[ -z "$app_version" && "${GITHUB_REF_TYPE:-}" == "tag" ]]; then
9-
app_version="${GITHUB_REF_NAME#v}"
9+
if [[ "${GITHUB_REF_TYPE:-}" == "tag" ]]; then
10+
tag_version="${GITHUB_REF_NAME#v}"
11+
if [[ ! "$tag_version" =~ ^[0-9]+[.][0-9]+[.][0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then
12+
echo "Release tag must be stable or prerelease SemVer with a leading v; got: ${GITHUB_REF_NAME:-}" >&2
13+
exit 1
14+
fi
15+
fi
16+
17+
if [[ -z "$app_version" && -n "$tag_version" ]]; then
18+
app_version="${tag_version%%-*}"
1019
fi
1120

1221
if [[ -n "$app_version" && ! "$app_version" =~ ^[0-9]+[.][0-9]+[.][0-9]+$ ]]; then
13-
echo "APP_VERSION must be stable SemVer without a leading v; got: $app_version" >&2
22+
echo "APP_VERSION must be stable SemVer without a leading v because Apple bundle versions do not include prerelease labels; got: $app_version" >&2
1423
exit 1
1524
fi
1625

0 commit comments

Comments
 (0)