-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.57 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
# workflow name
name: Generate release-artifacts
on:
release:
types: [created]
permissions:
contents: write
packages: write
# workflow tasks
jobs:
release-matrix:
name: Release Go binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows, freebsd]
goarch: [amd64, 386, arm64, arm]
exclude:
- goos: darwin
goarch: 386
- goos: darwin
goarch: arm
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v2
with:
go-version: 1.23.1
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build
- name: Archive Zip
if: matrix.goos == 'windows'
run: |
7z a -tzip masterclass-dl-${{ matrix.goos }}-${{ matrix.goarch }}.zip masterclass-dl.exe
- name: Archive Tar
if: matrix.goos != 'windows'
run: |
tar -czf masterclass-dl-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz masterclass-dl
- name: Upload to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./masterclass-dl-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }}
asset_name: masterclass-dl-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.goos == 'windows' && '.zip' || '.tar.gz' }}
asset_content_type: application/octet-stream