-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.2 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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build
on:
push:
paths:
- "**.go"
- go.mod
- go.sum
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [windows, darwin, linux]
arch: [amd64, 386]
exclude:
- platform: darwin
arch: 386
steps:
- name: Set up repo
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: go build -o release/
env:
GOOS: ${{ matrix.platform }}
GOARCH: ${{ matrix.arch }}
- name: Upload binaries to release
run: |
binary=(release/*)
archive=ao3fetch-${{ github.ref_name }}-${{ matrix.platform }}-${{ matrix.arch }}.zip
zip $archive ${binary[0]}
gh release upload ${{ github.ref_name }} $archive#${{ matrix.platform }}-${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ github.token }}
if: github.event_name == 'release'