Skip to content

Commit cd9bbb8

Browse files
feat: new release workflow
1 parent 7da7e83 commit cd9bbb8

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: golangci/golangci-lint-action@v2
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-go@v3
15+
with:
16+
go-version: 1.19
17+
- uses: golangci/golangci-lint-action@v3
1518
build:
1619
runs-on: ${{ matrix.os }}
1720
needs: lint
@@ -20,35 +23,23 @@ jobs:
2023
matrix:
2124
os: [macos-latest, windows-latest, ubuntu-latest]
2225
steps:
23-
- uses: actions/checkout@v2
24-
- uses: actions/setup-go@v2
26+
- uses: actions/checkout@v3
27+
- uses: actions/setup-go@v3
2528
with:
26-
go-version: 1.17
29+
go-version: 1.19
2730
- run: go build ./cmd/files-updater-helm/
2831
- run: go test -v ./...
2932
release:
3033
runs-on: ubuntu-latest
3134
needs: build
3235
steps:
33-
- uses: actions/checkout@v2
34-
- uses: actions/setup-go@v2
36+
- uses: actions/checkout@v3
37+
- uses: actions/setup-go@v3
3538
with:
36-
go-version: 1.17
37-
- run: |
38-
go install github.com/mitchellh/gox@latest
39-
go install github.com/tcnksm/ghr@latest
39+
go-version: 1.19
4040
- uses: go-semantic-release/action@v1
41-
id: semrel
4241
with:
43-
github-token: ${{ secrets.GITHUB_TOKEN }}
44-
ghr: true
45-
- run: |
46-
gox -parallel 4 -osarch="linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 linux/arm windows/amd64" -ldflags="-extldflags '-static' -s -w -X github.com/go-semantic-release/files-updater-helm/pkg/updater.FUVERSION=${{steps.semrel.outputs.version}}" -output="bin/{{.Dir}}_v${{steps.semrel.outputs.version}}_{{.OS}}_{{.Arch}}" ./cmd/files-updater-helm/
47-
cd bin/ && shasum -a 256 * > ./files-updater-helm_v${{steps.semrel.outputs.version}}_checksums.txt && cd -
48-
if: steps.semrel.outputs.version != ''
49-
env:
50-
CGO_ENABLED: 0
51-
- run: ghr $(cat .ghr) bin/
52-
if: steps.semrel.outputs.version != ''
42+
hooks: goreleaser,plugin-registry-update
5343
env:
5444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
PLUGIN_REGISTRY_ADMIN_ACCESS_TOKEN: ${{ secrets.PLUGIN_REGISTRY_ADMIN_ACCESS_TOKEN }}

.goreleaser.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
builds:
2+
- env:
3+
- CGO_ENABLED=0
4+
targets:
5+
- linux_amd64
6+
- linux_arm64
7+
- darwin_amd64
8+
- darwin_arm64
9+
- linux_arm
10+
- windows_amd64
11+
main: ./cmd/files-updater-helm/
12+
ldflags:
13+
- -extldflags '-static'
14+
- -s -w -X github.com/go-semantic-release/files-updater-helm/pkg/updater.FUVERSION={{.Version}}
15+
16+
archives:
17+
- format: binary
18+
name_template: '{{ .Binary }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
19+
20+
checksum:
21+
name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt'

0 commit comments

Comments
 (0)