v1.5.4 #70
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_*"]' |