Skip to content

Commit ecc2af1

Browse files
committed
Tweak goreleaser to create AWS lambda compatible assets
1 parent e87dd3e commit ecc2af1

File tree

2 files changed

+15
-42
lines changed

2 files changed

+15
-42
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,30 @@ name: release
44
on:
55
push:
66
tags:
7-
- '*'
7+
- 'v[0-9]+.[0-9]+.[0-9]+*'
88

9-
jobs:
10-
test:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Check out code into the Go module directory
14-
uses: actions/checkout@v3
15-
16-
- name: Setup go
17-
uses: actions/setup-go@v4
18-
with:
19-
go-version: '1.20.x'
20-
21-
- name: Install staticcheck
22-
run: go install honnef.co/go/tools/cmd/staticcheck@latest
23-
24-
- name: Run staticcheck
25-
run: staticcheck ./...
26-
27-
- name: Run Tests
28-
run: go test -p 1 -cover -race -v ./...
9+
permissions:
10+
contents: write
2911

12+
jobs:
3013
release:
3114
runs-on: ubuntu-latest
32-
needs: [ test ]
3315
steps:
3416
- name: Checkout
35-
uses: actions/checkout@v3
36-
37-
- name: Unshallow
38-
run: git fetch --prune --unshallow
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
fetch-tags: true
3921

4022
- name: Set up Go
4123
uses: actions/setup-go@v4
4224
with:
43-
go-version: '1.20.x'
25+
go-version: '1.21.x'
4426

4527
- name: Run GoReleaser
46-
uses: goreleaser/goreleaser-action@v4
28+
uses: goreleaser/goreleaser-action@v5
4729
with:
4830
version: latest
49-
args: release --rm-dist
31+
args: release --clean
5032
env:
5133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,19 @@ before:
55
hooks:
66
- go mod download
77
builds:
8-
- env:
8+
- id: '{{ .ProjectName }}'
9+
binary: bootstrap
10+
env:
911
- CGO_ENABLED=0
1012
goos:
1113
- linux
12-
- darwin
13-
- windows
1414
goarch:
15-
- 386
1615
- amd64
17-
- arm
1816
- arm64
19-
ignore:
20-
- goos: darwin
21-
goarch: 386
22-
- goos: windows
23-
goarch: 386
2417
ldflags:
2518
- -s -w -X github.com/awslabs/ssosync/cmd.version={{.Version}} -X github.com/awslabs/ssosync/cmd.commit={{.Commit}} -X github.com/awslabs/ssosync/cmd.date={{.Date}} -X github.com/awslabs/ssosync/cmd.builtBy=goreleaser
2619
checksum:
27-
name_template: '{{ .ProjectName }}_checksums.txt'
20+
name_template: '{{ .ProjectName }}_checksum.txt'
2821
changelog:
2922
sort: asc
3023
filters:
@@ -38,10 +31,8 @@ archives:
3831
{{- .ProjectName }}_
3932
{{- title .Os }}_
4033
{{- if eq .Arch "amd64" }}x86_64
41-
{{- else if eq .Arch "386" }}i386
4234
{{- else }}{{ .Arch }}{{ end }}
4335
{{- if .Arm }}v{{ .Arm }}{{ end -}}
4436
format_overrides:
4537
- goos: windows
4638
format: zip
47-

0 commit comments

Comments
 (0)