@@ -27,111 +27,21 @@ jobs:
2727 - name : Run tests
2828 run : go test -v -race ./...
2929
30- - name : Build binaries
31- run : |
32- VERSION=${GITHUB_REF_NAME}
33- COMMIT=$(git rev-parse --short HEAD)
34- DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
35- LDFLAGS="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}"
36-
37- mkdir -p dist
38-
39- # Build for each platform
40- platforms=(
41- "linux/amd64"
42- "linux/arm64"
43- "darwin/amd64"
44- "darwin/arm64"
45- "windows/amd64"
46- "windows/arm64"
47- )
48-
49- for platform in "${platforms[@]}"; do
50- GOOS=${platform%/*}
51- GOARCH=${platform#*/}
52-
53- output_name="atl-${GOOS}-${GOARCH}"
54- if [ "$GOOS" = "windows" ]; then
55- output_name+=".exe"
56- fi
57-
58- echo "Building $output_name..."
59- GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "${LDFLAGS}" -o "dist/${output_name}" ./cmd/atl
60- done
61-
62- # Create archives
63- cd dist
64- for file in atl-*; do
65- if [[ "$file" == *.exe ]]; then
66- zip "${file%.exe}.zip" "$file"
67- rm "$file"
68- else
69- tar czf "${file}.tar.gz" "$file"
70- rm "$file"
71- fi
72- done
73-
74- # Generate checksums
75- sha256sum * > checksums.txt
76-
77- - name : Generate changelog
78- id : changelog
79- run : |
80- # Get previous tag
81- PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
82-
83- if [ -n "$PREV_TAG" ]; then
84- echo "Generating changelog from $PREV_TAG to $GITHUB_REF_NAME"
85- CHANGELOG=$(git log --pretty=format:"- %s (%h)" "$PREV_TAG".."$GITHUB_REF_NAME" --no-merges)
86- else
87- echo "No previous tag found, including all commits"
88- CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges)
89- fi
90-
91- # Escape for GitHub Actions
92- echo "changelog<<EOF" >> $GITHUB_OUTPUT
93- echo "$CHANGELOG" >> $GITHUB_OUTPUT
94- echo "EOF" >> $GITHUB_OUTPUT
95-
96- - name : Create Release
97- uses : softprops/action-gh-release@v2
30+ - name : Generate GitHub App token for tap
31+ id : app-token
32+ uses : actions/create-github-app-token@v2
9833 with :
99- name : ${{ github.ref_name }}
100- body : |
101- ## What's Changed
102-
103- ${{ steps.changelog.outputs.changelog }}
104-
105- ## Installation
106-
107- ### macOS (Apple Silicon)
108- ```bash
109- curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-darwin-arm64.tar.gz | tar xz
110- chmod +x atl-darwin-arm64
111- sudo mv atl-darwin-arm64 /usr/local/bin/atl
112- ```
113-
114- ### macOS (Intel)
115- ```bash
116- curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-darwin-amd64.tar.gz | tar xz
117- chmod +x atl-darwin-amd64
118- sudo mv atl-darwin-amd64 /usr/local/bin/atl
119- ```
34+ app-id : ${{ secrets.HOMEBREW_TAP_APP_ID }}
35+ private-key : ${{ secrets.HOMEBREW_TAP_APP_PRIVATE_KEY }}
36+ owner : enthus-appdev
37+ repositories : homebrew-tap
12038
121- ### Linux (x64)
122- ```bash
123- curl -L https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/atl-linux-amd64.tar.gz | tar xz
124- chmod +x atl-linux-amd64
125- sudo mv atl-linux-amd64 /usr/local/bin/atl
126- ```
127-
128- ### Windows
129- Download `atl-windows-amd64.zip` (or `atl-windows-arm64.zip` for ARM) and add to your PATH.
130-
131- ## Checksums
132-
133- See `checksums.txt` for SHA256 checksums of all binaries.
134- files : |
135- dist/*
136- draft : false
137- prerelease : ${{ contains(github.ref_name, '-') }}
39+ - name : Run GoReleaser
40+ uses : goreleaser/goreleaser-action@v6
41+ with :
42+ distribution : goreleaser
43+ version : " ~> v2"
44+ args : release --clean
45+ env :
46+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47+ HOMEBREW_TAP_TOKEN : ${{ steps.app-token.outputs.token }}
0 commit comments