-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.47 KB
/
release.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
name: Build and Release
on:
push:
tags:
- 'v*' # Trigger on tags that start with 'v'
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.1' # Adjust to your desired Go version
- name: Cache Go modules
uses: actions/cache@v2
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install UPX
run: |
latest_version=$(curl -s https://api.github.com/repos/upx/upx/releases/latest | grep -o '"tag_name": "v.*"' | cut -d'"' -f4)
download_url="https://github.com/upx/upx/releases/download/${latest_version}/upx-${latest_version#v}-amd64_linux.tar.xz"
curl -L -o upx.tar.xz $download_url
tar -xJf upx.tar.xz
mv upx-*-amd64_linux/upx /usr/local/bin/
- name: Build and Release
env:
NAME: connect_jxyy_network # Adjust the project name
BINDIR: bin
run: |
make releases
cp config_example.yaml bin/config.yaml
- name: Upload Release
uses: softprops/action-gh-release@v1
with:
files: bin/*
draft: true
token: ${{ secrets.GHCR_PAT }} # Use a GitHub Personal Access Token