Skip to content

Commit a224df5

Browse files
authored
fix: move ci to central repo (#23)
1 parent b136404 commit a224df5

3 files changed

Lines changed: 17 additions & 111 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@ name: Actionlint
22

33
on:
44
pull_request:
5-
branches:
6-
- main
5+
branches: [main]
76

87
permissions:
98
contents: read
109
pull-requests: write
1110

1211
jobs:
1312
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
13+
uses: user-cube/reusable-cicd/.github/workflows/actionlint.yml@main
Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,15 @@
11
name: Build and Test on PR
22
on:
33
pull_request:
4-
branches:
5-
- main
4+
branches: [main]
65

76
permissions:
87
contents: read
98
pull-requests: read
109

1110
jobs:
12-
build:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v6
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Set up Go
21-
uses: actions/setup-go@v6
22-
with:
23-
go-version: 1.26
24-
25-
- name: Run tests
26-
run: go test -v ./...
27-
28-
- name: golangci-lint
29-
uses: golangci/golangci-lint-action@v9
30-
with:
31-
version: latest
32-
33-
- name: Run linters
34-
run: golangci-lint run
35-
36-
- name: Build
37-
run: go build -v
11+
build-and-test:
12+
uses: user-cube/reusable-cicd/.github/workflows/golang-cli-apps_build-and-test-pr.yml@main
13+
with:
14+
go-version-file: go.mod
15+
go-sum-file: go.sum

.github/workflows/release.yml

Lines changed: 9 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,81 +3,18 @@ name: Release AWS CLI Manager
33

44
on:
55
push:
6-
# run only against semver tags
7-
branches:
8-
- main
9-
10-
concurrency:
11-
group: release-${{ github.ref }}
12-
cancel-in-progress: false
6+
branches: [main]
137

148
permissions:
159
contents: write
1610

1711
jobs:
1812
release:
19-
runs-on: ubuntu-latest
20-
outputs:
21-
new-release: ${{ steps.semantic.outputs.new_release_published }}
22-
version: ${{ steps.semantic.outputs.new_release_version }}
23-
steps:
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
36-
with:
37-
fetch-depth: 0
38-
token: ${{ steps.app.outputs.token }}
39-
40-
- uses: actions/setup-node@v6
41-
with:
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
74-
75-
- name: Run GoReleaser
76-
uses: goreleaser/goreleaser-action@v6
77-
with:
78-
version: "nightly" # TODO: Remove nightly once v2.14.0 is released
79-
args: release --clean
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
GORELEASER_CURRENT_TAG: v${{ needs.release.outputs.version }}
83-
HOMEBREW_TAP_TOKEN: ${{ steps.app.outputs.token }}
13+
uses: user-cube/reusable-cicd/.github/workflows/golang-cli-apps_release.yml@main
14+
secrets:
15+
DEVOPS_BUDDY_APP_ID: ${{ secrets.DEVOPS_BUDDY_APP_ID }}
16+
DEVOPS_BUDDY_PRIVATE_KEY: ${{ secrets.DEVOPS_BUDDY_PRIVATE_KEY }}
17+
with:
18+
homebrew-tap-repo: "homebrew-tap"
19+
go-version-file: go.mod
20+
go-sum-file: go.sum

0 commit comments

Comments
 (0)