1+ name : Release
2+
13on :
24 push :
35 tags :
46 - " v*"
5- watch :
6- types : started
7+ workflow_dispatch :
8+ inputs :
9+ upx_version :
10+ description : ' UPX version'
11+ required : true
12+ default : ' 3.96'
713
8- name : CI
914jobs :
1015 release :
11- name : Release
12- runs-on : ubuntu-latest
13- if : github.event.repository.owner.id == github.event.sender.id
16+ runs-on : ${{ matrix.os }}
17+ timeout-minutes : 30
18+ strategy :
19+ matrix :
20+ go : ["1.17.x"]
21+ os : [ubuntu-latest]
22+ name : Go ${{ matrix.go }} in ${{ matrix.os }}
1423 steps :
15- - name : Check out code
16- uses : actions/checkout@v2
24+ - uses : actions/checkout@v2
25+ - uses : actions/setup-go@v2
26+ with :
27+ go-version : ${{ matrix.go }}
28+ - name : Environment
29+ run : |
30+ go version
31+ go env
32+ # So GoReleaser can generate the changelog properly
33+ - name : Unshallowify the repo clone
34+ run : git fetch --prune --unshallow
35+
1736 - name : Check git tag exist
1837 run : |
1938 git fetch --depth=1 origin +refs/tags/*:refs/tags/*
@@ -26,10 +45,20 @@ jobs:
2645 echo "new tag: ${newtag}"
2746 git tag $newtag
2847 fi
29- - name : goreleaser
30- uses : docker://goreleaser/goreleaser:latest
48+
49+ - name : Installing upx
3150 env :
32- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
51+ UPX_VERSION : ${{ github.event.inputs.upx_version }}
52+ run : |
53+ echo "Installing upx .."
54+ curl -OL "https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz"
55+ tar xvf "upx-${UPX_VERSION}-amd64_linux.tar.xz"
56+ cp "upx-${UPX_VERSION}-amd64_linux/upx" "$(go env GOPATH)/bin"
57+ upx --version
58+ - name : Run GoReleaser
59+ uses : goreleaser/goreleaser-action@v2
3360 with :
34- args : release --skip-validate --skip-sign --debug --config .github/goreleaser.yml
35- if : success()
61+ version : latest
62+ args : release --rm-dist --skip-validate --skip-sign --debug
63+ env :
64+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments