-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.99 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (58 loc) · 1.99 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
59
60
61
62
63
64
65
66
67
name: release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: build ${{ matrix.target.name }}
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target:
- { name: darwin-arm64, os: macos-14, goos: darwin, goarch: arm64 }
- { name: linux-amd64, os: ubuntu-24.04, goos: linux, goarch: amd64 }
- { name: linux-arm64, os: ubuntu-24.04, goos: linux, goarch: arm64 }
# darwin-amd64 (Intel Mac) intentionally dropped: macos-13 GH runners
# are perpetually queued. Users on Intel Macs can build from source.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: build
env:
GOOS: ${{ matrix.target.goos }}
GOARCH: ${{ matrix.target.goarch }}
CGO_ENABLED: '0'
run: |
mkdir -p dist
go build -trimpath -ldflags="-s -w" -o dist/wtkill .
cd dist
tar -czf wtkill-${{ github.ref_name }}-${{ matrix.target.name }}.tar.gz wtkill
shasum -a 256 wtkill-${{ github.ref_name }}-${{ matrix.target.name }}.tar.gz > wtkill-${{ github.ref_name }}-${{ matrix.target.name }}.tar.gz.sha256
- uses: actions/upload-artifact@v4
with:
name: wtkill-${{ matrix.target.name }}
path: |
dist/wtkill-${{ github.ref_name }}-${{ matrix.target.name }}.tar.gz
dist/wtkill-${{ github.ref_name }}-${{ matrix.target.name }}.tar.gz.sha256
release:
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--title "wtkill ${GITHUB_REF_NAME}" \
--generate-notes \
dist/*.tar.gz dist/*.sha256