-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (109 loc) · 2.86 KB
/
release.yml
File metadata and controls
115 lines (109 loc) · 2.86 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-linux:
name: Build (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24.1'
- name: Build
env:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 1
run: |
output=c2c-linux-amd64
go build -o $output ./main.go
echo "artifact=$output" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}
build-windows:
name: Build (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24.1'
- name: Build
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: 1
run: |
$output = "c2c-windows-amd64.exe"
go build -o $output ./main.go
echo "artifact=$output" | Out-File -FilePath $env:GITHUB_ENV -Append
- uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}
build-macos-amd64:
name: Build (macOS amd64)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24.1'
- name: Build
env:
GOOS: darwin
GOARCH: amd64
CGO_ENABLED: 1
run: |
output=c2c-darwin-amd64
go build -o $output ./main.go
echo "artifact=$output" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}
build-macos-arm64:
name: Build (macOS arm64)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24.1'
- name: Build
env:
GOOS: darwin
GOARCH: arm64
CGO_ENABLED: 1
run: |
output=c2c-darwin-arm64
go build -o $output ./main.go
echo "artifact=$output" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact }}
path: ${{ env.artifact }}
release:
name: Release
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-macos-amd64, build-macos-arm64]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./dist
- name: List artifacts (debug)
run: ls -R ./dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/**/c2c*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}