Skip to content

Commit dd7245e

Browse files
committed
Add automated release workflow
1 parent fb967fd commit dd7245e

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,37 @@ on:
77
tags:
88
- 'v*'
99

10+
permissions:
11+
contents: write
12+
1013
jobs:
1114
release:
1215
runs-on: ubuntu-latest
1316
steps:
1417
- name: Checkout
1518
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
1621

1722
- name: Setup Go
1823
uses: actions/setup-go@v5
1924
with:
2025
go-version: '1.21'
2126

22-
- name: Build binaries
27+
- name: Run tests
28+
run: go test ./...
29+
30+
- name: Build release binaries
2331
run: |
2432
VERSION=${GITHUB_REF#refs/tags/}
25-
./scripts/build.sh
33+
echo "Building version $VERSION"
34+
chmod +x scripts/build.sh
35+
VERSION=$VERSION ./scripts/build.sh
36+
37+
- name: Generate changelog
38+
run: |
39+
echo "## What's Changed" > CHANGELOG.md
40+
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s" >> CHANGELOG.md
2641
2742
- name: Create Release
2843
uses: softprops/action-gh-release@v1
@@ -31,8 +46,20 @@ jobs:
3146
dist/*.tar.gz
3247
dist/*.zip
3348
dist/checksums.txt
49+
body_path: CHANGELOG.md
3450
draft: false
3551
prerelease: false
36-
generate_release_notes: true
3752
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
update-homebrew:
56+
needs: release
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Trigger Homebrew Update
60+
uses: peter-evans/repository-dispatch@v2
61+
with:
62+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
63+
repository: localcloud-sh/homebrew-tap
64+
event-type: update-formula
65+
client-payload: '{"version": "${{ github.ref_name }}"}'

0 commit comments

Comments
 (0)