This repository was archived by the owner on Jun 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (65 loc) · 1.96 KB
/
compile.yml
File metadata and controls
80 lines (65 loc) · 1.96 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
name: Build and upload Go binaries
on:
push:
paths:
- '**.go'
pull_request:
paths:
- '**.go'
jobs:
build:
name: Build Go project
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.23.4
- name: Install Dependencies
run: go mod tidy
- name: Build Binary linux/amd64
run: GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -tags=jsoniter -o vxinst-linux-amd64 .
- name: Build Binary darwin/amd64
run: GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -tags=jsoniter -o vxinst-darwin-amd64 .
- name: Upload Binary Artifact linux/amd64
uses: actions/upload-artifact@v4
with:
name: vxinst-linux-amd64
path: vxinst-linux-amd64
- name: Upload Binary Artifact darwin/amd64
uses: actions/upload-artifact@v4
with:
name: vxinst-darwin-amd64
path: vxinst-darwin-amd64
release:
name: Create GitHub Release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Latest Tag
id: get_tag
run: echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Download linux/amd64
uses: actions/download-artifact@v4
with:
name: vxinst-linux-amd64
path: .
- name: Download darwin/amd64
uses: actions/download-artifact@v4
with:
name: vxinst-darwin-amd64
path: .
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
gh release create $TAG_NAME \
vxinst-linux-amd64 \
vxinst-darwin-amd64 \
--title "$TAG_NAME" \
--notes "Automated release for $TAG_NAME"