Skip to content

Commit 3790d27

Browse files
authored
Merge pull request #43 from icann/goreleaser_ci
Use goreleaser for building releases
2 parents b82183d + 21a0d43 commit 3790d27

File tree

1 file changed

+13
-39
lines changed

1 file changed

+13
-39
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,27 @@ on:
66

77
name: Release
88

9-
defaults:
10-
run:
11-
shell: bash
9+
permissions:
10+
contents: write
1211

1312
jobs:
1413
release:
1514
name: Build and publish release
1615
runs-on: ubuntu-latest
17-
permissions:
18-
contents: write
19-
strategy:
20-
matrix:
21-
go-version:
22-
- "1.25.2"
23-
go-os-arch:
24-
- "linux/amd64"
25-
- "linux/arm64"
26-
- "darwin/amd64"
27-
- "darwin/arm64"
28-
- "freebsd/amd64"
29-
- "freebsd/arm64"
30-
- "netbsd/amd64"
31-
- "netbsd/arm64"
32-
- "openbsd/amd64"
33-
- "openbsd/arm64"
3416
steps:
35-
- uses: actions/checkout@v4
36-
- name: Setup Go ${{ matrix.go-version }}
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Set up Go
3722
uses: actions/setup-go@v5
3823
with:
39-
go-version: ${{ matrix.go-version }}
40-
- name: Get OS and arch info
41-
run: |
42-
GOOSARCH=${{matrix.go-os-arch}}
43-
GOOS=${GOOSARCH%/*}
44-
GOARCH=${GOOSARCH#*/}
45-
BINARY_NAME=dnsmag-$GOOS-$GOARCH
46-
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
47-
echo "GOOS=$GOOS" >> $GITHUB_ENV
48-
echo "GOARCH=$GOARCH" >> $GITHUB_ENV
49-
- name: Build
50-
run: |
51-
make BINARY_NAME=${{env.BINARY_NAME}} clean build
52-
- name: Release
53-
uses: softprops/action-gh-release@v2
24+
go-version: stable
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
5427
with:
55-
draft: true
56-
files: ${{env.BINARY_NAME}}
28+
distribution: goreleaser
29+
version: "~> v2"
30+
args: release --clean
5731
env:
5832
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)