-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (41 loc) · 1.75 KB
/
build.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
name: build release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o busuanzi-sync-linux-amd64-${{ github.ref_name }}
GOOS=linux GOARCH=arm64 go build -o busuanzi-sync-linux-arm64-${{ github.ref_name }}
GOOS=darwin GOARCH=amd64 go build -o busuanzi-sync-darwin-amd64-${{ github.ref_name }}
GOOS=darwin GOARCH=arm64 go build -o busuanzi-sync-darwin-arm64-${{ github.ref_name }}
GOOS=windows GOARCH=amd64 go build -o busuanzi-sync-windows-amd64-${{ github.ref_name }}.exe
GOOS=windows GOARCH=arm64 go build -o busuanzi-sync-windows-arm64-${{ github.ref_name }}.exe
GOOS=windows GOARCH=386 go build -o busuanzi-sync-windows-386-${{ github.ref_name }}.exe
- name: Archive
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
busuanzi-sync-linux-amd64-${{ github.ref_name }}
busuanzi-sync-linux-arm64-${{ github.ref_name }}
busuanzi-sync-darwin-amd64-${{ github.ref_name }}
busuanzi-sync-darwin-arm64-${{ github.ref_name }}
busuanzi-sync-windows-amd64-${{ github.ref_name }}.exe
busuanzi-sync-windows-arm64-${{ github.ref_name }}.exe
busuanzi-sync-windows-386-${{ github.ref_name }}.exe
token: ${{ secrets.GITHUB_TOKEN }}
release_name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body: ${{ github.event.release.body }}
draft: true