forked from dimitri/regresql
-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (67 loc) · 1.84 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (67 loc) · 1.84 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
68
69
70
name: Release
on:
push:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: aarch64-apple-darwin
goos: darwin
goarch: arm64
- target: x86_64-apple-darwin
goos: darwin
goarch: amd64
- target: aarch64-unknown-linux-gnu
goos: linux
goarch: arm64
- target: x86_64-unknown-linux-gnu
goos: linux
goarch: amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
CGO_ENABLED: 0
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build \
-ldflags "-s -w -X github.com/boringsql/regresql/v2/internal/cli.version=${GITHUB_REF_NAME}" \
-o regresql \
./cmd/regresql
- name: Archive
run: tar -cJf regresql-${{ matrix.target }}.tar.xz regresql
- uses: actions/upload-artifact@v4
with:
name: tar-${{ matrix.target }}
path: regresql-${{ matrix.target }}.tar.xz
retention-days: 1
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: tar-*
merge-multiple: true
path: dist/
- name: Checksums
run: cd dist && shasum -a 256 *.tar.xz > checksums.txt
- name: Publish release
run: |
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--generate-notes \
dist/*.tar.xz dist/checksums.txt
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}