-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (49 loc) · 1.35 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
60
61
name: Build and Release
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
goos: [windows, darwin, linux]
goarch: [amd64]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- name: Build
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o zaicmd-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Compress artifact
run: tar -czvf zaicmd-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz zaicmd-${{ matrix.goos }}-${{ matrix.goarch }}
- name: Upload Release Asset
uses: actions/upload-artifact@v4
with:
name: zaicmd-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
path: zaicmd-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./downloads
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.CR_PAT}}
with:
files: |
./downloads/**