-
Notifications
You must be signed in to change notification settings - Fork 12
59 lines (58 loc) · 2.64 KB
/
release.yml
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
on:
release:
types: [published]
name: Publish Release Binaries
jobs:
release:
name: Build and Upload Release Binaries
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.x
- name: Build binaries
run: |
GOPATH=${{ runner.temp }}/go CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install src.agwa.name/snid/...@${{ github.event.release.name }}
GOPATH=${{ runner.temp }}/go CGO_ENABLED=0 GOOS=linux GOARCH=arm go install src.agwa.name/snid/...@${{ github.event.release.name }}
GOPATH=${{ runner.temp }}/go CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go install src.agwa.name/snid/...@${{ github.event.release.name }}
GOPATH=${{ runner.temp }}/go CGO_ENABLED=0 GOOS=linux GOARCH=386 go install src.agwa.name/snid/...@${{ github.event.release.name }}
- name: Upload binaries
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require("fs").promises;
const { repo: { owner, repo }, sha } = context;
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.release.id }},
name: "snid-${{ github.event.release.name }}-linux-amd64",
data: await fs.readFile("${{ runner.temp }}/go/bin/snid"),
});
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.release.id }},
name: "snid-${{ github.event.release.name }}-linux-arm",
data: await fs.readFile("${{ runner.temp }}/go/bin/linux_arm/snid"),
});
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.release.id }},
name: "snid-${{ github.event.release.name }}-linux-arm64",
data: await fs.readFile("${{ runner.temp }}/go/bin/linux_arm64/snid"),
});
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.release.id }},
name: "snid-${{ github.event.release.name }}-linux-386",
data: await fs.readFile("${{ runner.temp }}/go/bin/linux_386/snid"),
});
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: ${{ github.event.release.id }},
name: "sum.golang.org-sth",
data: await fs.readFile("${{ runner.temp }}/go/pkg/sumdb/sum.golang.org/latest"),
});