-
Notifications
You must be signed in to change notification settings - Fork 152
91 lines (80 loc) · 2.58 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (80 loc) · 2.58 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
name: Create Release on Version Change
on:
push:
paths:
- 'VERSION'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.x'
cache-dependency-path: core/scripts/auth/go.sum
- name: Read version from VERSION file
id: get_version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Initialize Go module
working-directory: ./core/scripts/auth
run: |
go mod init hysteria_auth
go mod tidy
- name: Build and Package for linux-amd64
id: package_amd64
run: |
(cd core/scripts/auth && GOOS=linux GOARCH=amd64 go build -o user_auth .)
zip_name="Blitz-amd64.zip"
zip -r "$zip_name" . \
-x ".git/*" \
".github/*" \
".gitignore" \
"CONTRIBUTING.md" \
"LICENSE" \
"README*.md" \
"SECURITY.md" \
"changelog" \
"core/scripts/auth/go.*" \
"core/scripts/auth/user_auth.go" \
".vscode/*"
rm core/scripts/auth/user_auth
echo "zip_name=$zip_name" >> $GITHUB_OUTPUT
- name: Build and Package for linux-arm64
id: package_arm64
run: |
(cd core/scripts/auth && GOOS=linux GOARCH=arm64 go build -o user_auth .)
zip_name="Blitz-arm64.zip"
zip -r "$zip_name" . \
-x ".git/*" \
".github/*" \
".gitignore" \
"CONTRIBUTING.md" \
"LICENSE" \
"README*.md" \
"SECURITY.md" \
"changelog" \
"core/scripts/auth/go.*" \
"core/scripts/auth/user_auth.go" \
".vscode/*"
rm core/scripts/auth/user_auth
echo "zip_name=$zip_name" >> $GITHUB_OUTPUT
- name: Read changelog for release description
id: get_changelog
run: |
changelog=$(cat changelog)
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$changelog" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: "${{ steps.get_version.outputs.version }}"
body: ${{ steps.get_changelog.outputs.changelog }}
files: |
${{ steps.package_amd64.outputs.zip_name }}
${{ steps.package_arm64.outputs.zip_name }}
draft: false
prerelease: false