-
Notifications
You must be signed in to change notification settings - Fork 199
85 lines (85 loc) · 2.72 KB
/
release.yaml
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
on:
release:
types: [published]
env:
CGO_ENABLED: 0
name: Release qshell
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
strategy:
max-parallel: 1
matrix:
include:
# macOS targets
- goarch: amd64
goos: darwin
- goarch: arm64
goos: darwin
# Linux targets
- goarch: "386"
goos: linux
- goarch: amd64
goos: linux
- goarch: arm
goos: linux
- goarch: arm64
goos: linux
- goarch: mips
goos: linux
- goarch: mipsle
goos: linux
- goarch: mips64
goos: linux
- goarch: mips64le
goos: linux
- goarch: loong64
goos: linux
- goarch: riscv64
goos: linux
# Windows targets
- goarch: "386"
goos: windows
- goarch: amd64
goos: windows
- goarch: arm
goos: windows
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v4
- name: Set APP_VERSION env
run: echo ::set-env name=APP_VERSION::$(cat ${GITHUB_EVENT_PATH} | jq -r .release.tag_name )
- name: Prepare qshell
run: |
set -e
wget -qLO /tmp/qshell-v2.11.0-linux-amd64.tar.gz https://devtools.qiniu.com/qshell-v2.11.0-linux-amd64.tar.gz
tar xf /tmp/qshell-v2.11.0-linux-amd64.tar.gz
rm /tmp/qshell-v2.11.0-linux-amd64.tar.gz
./qshell account -- "$PUBLISH_ACCESS_KEY" "$PUBLISH_SECRET_KEY" default
env:
PUBLISH_ACCESS_KEY: ${{ secrets.PUBLISH_ACCESS_KEY }}
PUBLISH_SECRET_KEY: ${{ secrets.PUBLISH_SECRET_KEY }}
- uses: wangyoucao577/go-release-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://go.dev/dl/go1.23.2.linux-amd64.tar.gz"
ldflags: -X "github.com/qiniu/qshell/v2/iqshell/common/version.version=${{ env.APP_VERSION }}" -extldflags "-static"
project_path: "./main"
retry: '100'
- name: Upload Release Asset to Qiniu
run: |
set -e
cd ./main/
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz"
if [ "${{ matrix.goos }}" = "windows" ]; then
FILENAME="qshell-${{ env.APP_VERSION }}-${{ matrix.goos }}-${{ matrix.goarch }}.zip"
fi
../qshell rput --resumable-api-v2 --overwrite "$PUBLISH_BUCKET_NAME" "$FILENAME" "$FILENAME"
env:
PUBLISH_BUCKET_NAME: ${{ secrets.PUBLISH_BUCKET_NAME }}