Skip to content

Commit bfe33e5

Browse files
committed
fix(build): use tag name as DMG version for pre-releases
Add --version flag to build_release.sh. The release workflow now passes the tag name (e.g. 0.3.0-rc1) so the DMG filename and Info.plist reflect the actual release version including pre-release suffixes.
1 parent 61858ae commit bfe33e5

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,24 @@ jobs:
6363
TEAM_ID: ${{ secrets.TEAM_ID }}
6464
APP_PASSWORD: ${{ secrets.APP_PASSWORD }}
6565
run: |
66+
# Use tag name as version (v0.3.0-rc1 → 0.3.0-rc1), fall back to VERSION file
67+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
68+
BUILD_VERSION="--version=${GITHUB_REF_NAME#v}"
69+
fi
6670
if [ -n "$DEVELOPER_ID" ]; then
67-
./scripts/build_release.sh
71+
./scripts/build_release.sh ${BUILD_VERSION:-}
6872
else
69-
./scripts/build_release.sh --no-notarize
73+
./scripts/build_release.sh --no-notarize ${BUILD_VERSION:-}
7074
fi
7175
7276
- name: Get version
7377
id: version
7478
run: |
75-
VERSION=$(cat VERSION | tr -d '[:space:]')
79+
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
80+
VERSION="${GITHUB_REF_NAME#v}"
81+
else
82+
VERSION=$(cat VERSION | tr -d '[:space:]')
83+
fi
7684
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
7785
7886
- name: Compute DMG SHA256

scripts/build_release.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,20 @@ MACOS_DIR="$CONTENTS/MacOS"
3030
RESOURCES="$CONTENTS/Resources"
3131

3232
NOTARIZE=true
33+
OVERRIDE_VERSION=""
3334
for arg in "$@"; do
3435
case "$arg" in
3536
--no-notarize) NOTARIZE=false ;;
37+
--version=*) OVERRIDE_VERSION="${arg#--version=}" ;;
3638
esac
3739
done
3840

39-
# Read version from VERSION file
40-
VERSION=$(cat "$PROJECT_ROOT/VERSION" | tr -d '[:space:]')
41+
# Read version: prefer --version flag, then VERSION file
42+
if [ -n "$OVERRIDE_VERSION" ]; then
43+
VERSION="$OVERRIDE_VERSION"
44+
else
45+
VERSION=$(cat "$PROJECT_ROOT/VERSION" | tr -d '[:space:]')
46+
fi
4147
echo "Building MeetingTranscriber v${VERSION}"
4248
echo " Notarize: $NOTARIZE"
4349
echo "======================================="

0 commit comments

Comments
 (0)