-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.03 KB
/
go.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Go-build-macos
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
arch: [amd64, arm64]
exclude:
- os: windows-latest
arch: arm64
go-version: [1.22.x]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Install dependencies
run: go mod tidy
- name: Build
run: go build -v -o agdownloader-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: agdownloader-${{ matrix.os }}-${{ matrix.arch }}
path: agdownloader-${{ matrix.os }}-${{ matrix.arch }}
create_release:
name: Create Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download binaries
uses: actions/download-artifact@v3
with:
path: ./binaries
- name: List files in binaries directory
run: ls -laR ./binaries
- name: Zip all binaries
run: |
cd binaries
zip -r agdownloader-binaries.zip agdownloader-*
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
tag_name: v1.2.${{ github.run_number }}
release_name: Release v1.2.${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./binaries/agdownloader-binaries.zip
asset_name: agdownloader-binaries.zip
asset_content_type: application/zip