11# .github/workflows/release.yml
2- name : goreleaser
2+ name : Release AWS CLI Manager
33
44on :
55 push :
6- # run only against tags
7- tags :
8- - " *"
6+ # run only against semver tags
7+ branches :
8+ - main
9+
10+ concurrency :
11+ group : release-${{ github.ref }}
12+ cancel-in-progress : false
913
1014permissions :
1115 contents : write
12- packages : write
13- issues : write
1416
1517jobs :
1618 release :
1719 runs-on : ubuntu-latest
20+ outputs :
21+ new-release : ${{ steps.semantic.outputs.new_release_published }}
22+ version : ${{ steps.semantic.outputs.new_release_version }}
1823 steps :
19- - name : Checkout
20- uses : actions/checkout@v4
24+ - uses : actions/create-github-app-token@v2
25+ id : app
26+ with :
27+ app-id : ${{ secrets.DEVOPS_BUDDY_APP_ID }}
28+ private-key : ${{ secrets.DEVOPS_BUDDY_PRIVATE_KEY }}
29+
30+ - name : Setup Git (bot da App)
31+ run : |
32+ git config --global user.name "${{ steps.app.outputs.app-slug }}[bot]"
33+ git config --global user.email "${{ steps.app.outputs.app-slug }}[bot]@users.noreply.github.com"
34+
35+ - uses : actions/checkout@v6
2136 with :
2237 fetch-depth : 0
23-
24- - name : Set up Go
25- uses : actions/setup-go@v5
38+ token : ${{ steps.app.outputs.token }}
39+
40+ - uses : actions/setup-node@v6
2641 with :
27- go-version : stable
28-
29- - name : Extract version from tag
30- id : extract_version
31- run : |
32- # Extract version from tag (remove 'v' prefix if present)
33- TAG=${GITHUB_REF#refs/tags/}
34- VERSION=${TAG#v}
35- echo "VERSION=${VERSION}" >> $GITHUB_ENV
36- echo "Using version: ${VERSION}"
37-
38- - name : Set build variables
39- id : build_vars
40- run : |
41- # Get the short commit hash
42- COMMIT_SHA=$(git rev-parse --short HEAD)
43- echo "COMMIT_SHA=${COMMIT_SHA}" >> $GITHUB_ENV
44- echo "Using commit: ${COMMIT_SHA}"
42+ node-version : " 24"
43+
44+ - id : semantic
45+ uses : cycjimmy/semantic-release-action@v4
46+ with :
47+ extra_plugins : |
48+ @semantic-release/changelog
49+ @semantic-release/git
50+ env :
51+ GITHUB_TOKEN : ${{ steps.app.outputs.token }}
52+
53+ goreleaser :
54+ runs-on : ubuntu-latest
55+ needs : release
56+ if : needs.release.outputs.new-release == 'true'
57+ steps :
58+ - uses : actions/create-github-app-token@v2
59+ id : app
60+ with :
61+ app-id : ${{ secrets.DEVOPS_BUDDY_APP_ID }}
62+ private-key : ${{ secrets.DEVOPS_BUDDY_PRIVATE_KEY }}
63+ repositories : homebrew-tap
64+
65+ - uses : actions/checkout@v6
66+ with :
67+ fetch-depth : 0
68+ ref : v${{ needs.release.outputs.version }}
69+
70+ - uses : actions/setup-go@v6
71+ with :
72+ go-version-file : go.mod
73+ cache-dependency-path : go.sum
4574
46- # Set build date in ISO 8601 format
47- BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
48- echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_ENV
49- echo "Using build date: ${BUILD_DATE}"
50-
51- # More assembly might be required: Docker logins, GPG, etc.
52- # It all depends on your needs.
5375 - name : Run GoReleaser
5476 uses : goreleaser/goreleaser-action@v6
5577 with :
56- # either 'goreleaser' (default) or 'goreleaser-pro'
57- distribution : goreleaser
58- # 'latest', 'nightly', or a semver
59- version : latest
78+ version : " nightly" # TODO: Remove nightly once v2.14.0 is released
6079 args : release --clean
6180 env :
6281 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63- # Pass the build variables to GoReleaser
64- VERSION : ${{ env.VERSION }}
65- GIT_COMMIT : ${{ env.COMMIT_SHA }}
66- BUILD_DATE : ${{ env.BUILD_DATE }}
67- # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
68- # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
82+ GORELEASER_CURRENT_TAG : v${{ needs.release.outputs.version }}
83+ HOMEBREW_TAP_TOKEN : ${{ steps.app.outputs.token }}
0 commit comments