-
Notifications
You must be signed in to change notification settings - Fork 39
65 lines (61 loc) · 1.63 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Build Release
on:
push:
tags:
- v*
env:
TZ: Asia/Shanghai
jobs:
build:
name: Build And Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: './go.mod'
- name: install dependencies and set env.BIN_NAME
run: |
go version
make cli
gf version
echo ${{github.ref}}
pwd
- name: Build CLI Binary For All Platform
run: |
pwd
go work init
go work use -r .
cd cool-tools
go mod tidy
make pack.template-simple
make pack.docs
gf build
- name: Move Files Before Release
run: |
pwd
cd cool-tools/temp
for OS in *;do for FILE in $OS/*;\
do if [[ ${OS} =~ 'windows' ]];\
then mv $FILE cool-tools_${OS}.exe && rm -rf $OS;\
else mv $FILE cool-tools_$OS && rm -rf $OS;\
fi;done;done
pwd
ls
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: cool-tools Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["cool-tools/temp/cool-tools_*"]'