mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 20:28:17 +08:00
ci updates
This commit is contained in:
parent
c2fb7ada0a
commit
b0cf501782
30
.github/workflows/cli.yml
vendored
30
.github/workflows/cli.yml
vendored
@ -9,7 +9,6 @@ on:
|
|||||||
env:
|
env:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build And Release
|
name: Build And Release
|
||||||
@ -30,37 +29,12 @@ jobs:
|
|||||||
GOOS=linux GOARCH=amd64 go build main.go
|
GOOS=linux GOARCH=amd64 go build main.go
|
||||||
chmod +x main
|
chmod +x main
|
||||||
./main install -y
|
./main install -y
|
||||||
|
|
||||||
# gf build
|
|
||||||
- name: Build CLI Binary For All Platform
|
- name: Build CLI Binary For All Platform
|
||||||
run: |
|
run: |
|
||||||
cd cmd/gf
|
cd cmd/gf
|
||||||
gf build main.go -n gf -a all -s all
|
gf build main.go -n gf -a all -s all
|
||||||
|
|
||||||
# 处理gf-cli批量编译后的文件结构
|
|
||||||
- name: Move Files Before Upx
|
|
||||||
run: |
|
|
||||||
cd cmd/gf/bin
|
|
||||||
for OS in *;do for FILE in $OS/*;\
|
|
||||||
do if [[ ${OS} =~ 'windows' ]];\
|
|
||||||
then rm -rf noupx && mkdir noupx && mv $FILE noupx/gf_$OS.exe && rm -rf $OS;\
|
|
||||||
else mv $FILE gf_$OS && rm -rf $OS;\
|
|
||||||
fi;done;done
|
|
||||||
|
|
||||||
# UPX 加壳所有文件
|
|
||||||
- name: Upx All Binary
|
|
||||||
uses: gacts/upx@master
|
|
||||||
with:
|
|
||||||
dir: 'cmd/gf/bin'
|
|
||||||
upx_args: '-9'
|
|
||||||
|
|
||||||
# 移动未UPX的windows程序到上传bin目录下
|
|
||||||
- name: Move Files After Upx
|
|
||||||
run: |
|
|
||||||
cd cmd/gf/bin
|
|
||||||
mv noupx/* ./ && rm -rf noupx
|
|
||||||
ls -l
|
|
||||||
|
|
||||||
- name: Create Github Release
|
- name: Create Github Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
@ -78,4 +52,4 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
asset_paths: '["cmd/gf/bin/gf_*"]'
|
asset_paths: '["cmd/gf/temp/gf_*"]'
|
||||||
|
Loading…
Reference in New Issue
Block a user