-
Notifications
You must be signed in to change notification settings - Fork 346
116 lines (93 loc) · 4.89 KB
/
Copy pathmain.yml
File metadata and controls
116 lines (93 loc) · 4.89 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
116
name: Build Go Project and Create Release
on:
push:
branches: [release]
permissions:
contents: write
jobs:
build_and_release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04]
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.26.5"
- name: Linux
if: matrix.os == 'ubuntu-24.04'
run: |
CGO_ENABLED=0 go build -ldflags="-s -w" -o tgpt-linux-amd64
CGO_ENABLED=0 GOARCH=386 go build -ldflags="-s -w" -o tgpt-linux-i386
CGO_ENABLED=0 GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-linux-arm64
CGO_ENABLED=0 GOARCH=arm go build -ldflags="-s -w" -o tgpt-linux-arm
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-amd64.exe
GOOS=windows GOARCH=arm go build -ldflags="-s -w" -o tgpt-arm.exe
GOOS=windows GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-arm64.exe
GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o tgpt-i386.exe
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-mac-amd64
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-mac-arm64
GOOS=netbsd GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-netbsd-amd64
GOOS=netbsd GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-netbsd-arm64
GOOS=netbsd GOARCH=arm go build -ldflags="-s -w" -o tgpt-netbsd-arm
GOOS=netbsd GOARCH=386 go build -ldflags="-s -w" -o tgpt-netbsd-i386
GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -o tgpt-freebsd-amd64
GOOS=freebsd GOARCH=arm64 go build -ldflags="-s -w" -o tgpt-freebsd-arm64
GOOS=freebsd GOARCH=arm go build -ldflags="-s -w" -o tgpt-freebsd-arm
GOOS=freebsd GOARCH=386 go build -ldflags="-s -w" -o tgpt-freebsd-i386
echo "## Changelog:" >> ${{ github.workspace }}-CHANGELOG.txt
echo "<details><summary>SHA256 Hashes</summary><code>" >> ${{ github.workspace }}-CHANGELOG.txt
echo "SHA256 hashes of the built binaries:"
echo "SHA256 hashes of the built binaries:" >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-linux-amd64
sha256sum tgpt-linux-amd64 >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-linux-i386
sha256sum tgpt-linux-i386 >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-linux-arm64
sha256sum tgpt-linux-arm64 >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-linux-arm
sha256sum tgpt-linux-arm >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-amd64.exe
sha256sum tgpt-amd64.exe >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-i386.exe
sha256sum tgpt-i386.exe >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-mac-amd64
sha256sum tgpt-mac-amd64 >> ${{ github.workspace }}-CHANGELOG.txt
sha256sum tgpt-mac-arm64
sha256sum tgpt-mac-arm64 >> ${{ github.workspace }}-CHANGELOG.txt
echo "</code></details>" >> ${{ github.workspace }}-CHANGELOG.txt
- name: Upload Artifacts
id: upload-artifacts
uses: softprops/action-gh-release@v3
with:
files: |
tgpt-linux-amd64
tgpt-linux-i386
tgpt-linux-arm64
tgpt-linux-arm
tgpt-amd64.exe
tgpt-i386.exe
tgpt-arm.exe
tgpt-arm64.exe
tgpt-mac-amd64
tgpt-mac-arm64
tgpt-netbsd-amd64
tgpt-netbsd-arm64
tgpt-netbsd-arm
tgpt-netbsd-i386
tgpt-freebsd-amd64
tgpt-freebsd-arm64
tgpt-freebsd-arm
tgpt-freebsd-i386
tgpt-openbsd-amd64
tgpt-openbsd-arm64
tgpt-openbsd-arm
tgpt-openbsd-i386
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
tag_name: v
name: tgpt
body_path: ${{ github.workspace }}-CHANGELOG.txt