Skip to content

Commit 59cf686

Browse files
committed
feat: update release process; homebrew tap
1 parent 7b18856 commit 59cf686

6 files changed

Lines changed: 315 additions & 52 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Actionlint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
actionlint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
19+
- name: actionlint
20+
uses: reviewdog/action-actionlint@v1
21+
with:
22+
reporter: github-pr-review

.github/workflows/build-and-test-on-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717
with:
1818
fetch-depth: 0
1919

2020
- name: Set up Go
21-
uses: actions/setup-go@v5
21+
uses: actions/setup-go@v6
2222
with:
23-
go-version: 1.23
23+
go-version: 1.26
2424

2525
- name: Run tests
2626
run: go test -v ./...
2727

2828
- name: golangci-lint
29-
uses: golangci/golangci-lint-action@v6
29+
uses: golangci/golangci-lint-action@v9
3030
with:
3131
version: latest
3232

3333
- name: Run linters
3434
run: golangci-lint run
3535

3636
- name: Build
37-
run: go build -v
37+
run: go build -v

.github/workflows/release.yml

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,83 @@
11
# .github/workflows/release.yml
2-
name: goreleaser
2+
name: Release AWS CLI Manager
33

44
on:
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

1014
permissions:
1115
contents: write
12-
packages: write
13-
issues: write
1416

1517
jobs:
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 }}

.releaserc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
branches:
2+
- main
3+
4+
plugins:
5+
- "@semantic-release/commit-analyzer"
6+
- "@semantic-release/release-notes-generator"
7+
- "@semantic-release/changelog"
8+
- - "@semantic-release/git"
9+
- assets:
10+
- CHANGELOG.md
11+
message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

0 commit comments

Comments
 (0)