fix(release): set AppVersion ldflags, git config, and tap token
- Set -X pkg/cli.AppVersion in ldflags so core --version reports the correct version instead of "dev" - Add git config user.name/email in update-tap job so commit succeeds - Use HOMEBREW_TAP_TOKEN secret instead of GITHUB_TOKEN for cross-repo push to host-uk/homebrew-tap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ecc161b725
commit
e1923095e1
2 changed files with 7 additions and 3 deletions
7
.github/workflows/alpha-release.yml
vendored
7
.github/workflows/alpha-release.yml
vendored
|
|
@ -61,7 +61,8 @@ jobs:
|
||||||
BINARY="core${EXT}"
|
BINARY="core${EXT}"
|
||||||
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
||||||
|
|
||||||
go build -ldflags "-s -w" -o "./bin/${BINARY}" .
|
APP_VERSION="${{ env.NEXT_VERSION }}-alpha.${{ github.run_number }}"
|
||||||
|
go build -ldflags "-s -w -X github.com/host-uk/core/pkg/cli.AppVersion=${APP_VERSION}" -o "./bin/${BINARY}" .
|
||||||
|
|
||||||
# Create tar.gz for Homebrew (non-Windows)
|
# Create tar.gz for Homebrew (non-Windows)
|
||||||
if [ "$GOOS" != "windows" ]; then
|
if [ "$GOOS" != "windows" ]; then
|
||||||
|
|
@ -159,7 +160,7 @@ jobs:
|
||||||
|
|
||||||
- name: Update Homebrew formula
|
- name: Update Homebrew formula
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||||
VERSION: ${{ needs.release.outputs.version }}
|
VERSION: ${{ needs.release.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
# Strip leading 'v' for formula version
|
# Strip leading 'v' for formula version
|
||||||
|
|
@ -214,6 +215,8 @@ jobs:
|
||||||
sed -i 's/^ //' /tmp/tap/Formula/core.rb
|
sed -i 's/^ //' /tmp/tap/Formula/core.rb
|
||||||
|
|
||||||
cd /tmp/tap
|
cd /tmp/tap
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git add .
|
git add .
|
||||||
git diff --cached --quiet && echo "No changes to tap" && exit 0
|
git diff --cached --quiet && echo "No changes to tap" && exit 0
|
||||||
git commit -m "Update core to ${FORMULA_VERSION}"
|
git commit -m "Update core to ${FORMULA_VERSION}"
|
||||||
|
|
|
||||||
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
|
|
@ -56,7 +56,8 @@ jobs:
|
||||||
BINARY="core${EXT}"
|
BINARY="core${EXT}"
|
||||||
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
ARCHIVE_PREFIX="core-${GOOS}-${GOARCH}"
|
||||||
|
|
||||||
go build -ldflags "-s -w" -o "./bin/${BINARY}" .
|
APP_VERSION="${GITHUB_REF_NAME#v}"
|
||||||
|
go build -ldflags "-s -w -X github.com/host-uk/core/pkg/cli.AppVersion=${APP_VERSION}" -o "./bin/${BINARY}" .
|
||||||
|
|
||||||
# Create tar.gz for Homebrew (non-Windows)
|
# Create tar.gz for Homebrew (non-Windows)
|
||||||
if [ "$GOOS" != "windows" ]; then
|
if [ "$GOOS" != "windows" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue