-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (57 loc) · 2.5 KB
/
release.yaml
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
name: release
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
jobs:
upload-binaries:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: setup-go
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: true
cache-dependency-path: go.sum
- name: release-darwin-amd64
run: |
ldflags=$(./scripts/golang-ldflags.sh)
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "$ldflags" -o ./bin/nix-search-darwin-amd64 ./cmd/nix-search
upload_url=$(./scripts/upsert-gh-release.sh)
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN}}" \
-H "Content-Type: application/octet-stream" \
--data-binary @bin/nix-search-darwin-amd64 \
"$upload_url?name=nix-search-darwin-amd64&label=nix-search-darwin-amd64"
- name: release-darwin-arm64
run: |
ldflags=$(./scripts/golang-ldflags.sh)
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags "$ldflags" -o ./bin/nix-search-darwin-arm64 ./cmd/nix-search
upload_url=$(./scripts/upsert-gh-release.sh)
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @bin/nix-search-darwin-arm64 \
"$upload_url?name=nix-search-darwin-arm64&label=nix-search-darwin-arm64"
- name: release-linux-arm64
run: |
ldflags=$(./scripts/golang-ldflags.sh)
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$ldflags" -o ./bin/nix-search-linux-arm64 ./cmd/nix-search
upload_url=$(./scripts/upsert-gh-release.sh)
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @bin/nix-search-linux-arm64 \
"$upload_url?name=nix-search-linux-arm64&label=nix-search-linux-arm64"
- name: release-linux-amd64
run: |
ldflags=$(./scripts/golang-ldflags.sh)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$ldflags" -o ./bin/nix-search-linux-amd64 ./cmd/nix-search
upload_url=$(./scripts/upsert-gh-release.sh)
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @bin/nix-search-linux-amd64 \
"$upload_url?name=nix-search-linux-amd64&label=nix-search-linux-amd64"