-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.69 KB
/
release-go-github.yml
File metadata and controls
58 lines (51 loc) · 1.69 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# .github/workflows/release.yaml
name: Build and Release Go App
on:
release:
types: [created]
permissions:
contents: read
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
packages: write
id-token: write
attestations: write
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- name: Checkout Code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Release Go Application
uses: wangyoucao577/go-release-action@279495102627de7960cbc33434ab01a12bae144b # v1.55
id: go_release
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./"
binary_name: ${{ github.event.repository.name }}
ldflags: "-X 'main.Version=${{ github.ref_name }}'"
md5sum: true
sha256sum: true
- name: GitHub Attestation for Artifacts
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
with:
subject-path: |
"${{ steps.go_release.outputs.release_asset_dir }}/*"
"${{ github.event.repository.name }}-${{ github.ref_name }}-*.tar.gz"
"${{ github.event.repository.name }}-${{ github.ref_name }}-*.zip"