-
Notifications
You must be signed in to change notification settings - Fork 11
35 lines (32 loc) · 1.01 KB
/
release.yml
File metadata and controls
35 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Release
permissions:
contents: write
on:
release:
types: [created]
jobs:
release-cli:
name: Release CLI binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/amd64
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
steps:
- uses: actions/checkout@v4
- name: Run tests
run: go test -v -p=1 -timeout=0 ./...
- name: Verify version subcommand for release tag
run: |
go build -ldflags="-s -w -X main.version=${{ github.event.release.tag_name }}" -o bin/mxlint ./.
test "$(./bin/mxlint version)" = "${{ github.event.release.tag_name }}"
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.PAT }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./"
binary_name: "mxlint"
ldflags: "-s -w -X main.version=${{ github.event.release.tag_name }}"
compress_assets: OFF