File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66on :
77 push :
88 branches : [ "master" ]
9+ tags :
10+ - " v*"
911 pull_request :
1012 branches : [ "master" ]
1113
2628
2729 - name : Test
2830 run : go test -v ./...
31+
32+ create-release :
33+ runs-on : ubuntu-latest
34+ if : startsWith(github.ref, 'refs/tags/v') # Only run this job when a valid tag is pushed
35+ steps :
36+ - name : Check if tag exists
37+ id : check_tag
38+ run : |
39+ if [ -n "$GITHUB_REF" ]; then
40+ TAG=${GITHUB_REF#refs/tags/}
41+ # echo "::set-output name=tag::$TAG"
42+ echo "TAG=${TAG}" >> $GITHUB_ENV
43+ else
44+ # echo "::set-output name=tag::"
45+ echo "TAG=" >> $GITHUB_ENV
46+ fi
47+ shell : bash
48+
49+ - name : Create GitHub Release
50+ id : create_release
51+ uses : softprops/action-gh-release@v1
52+ with :
53+ # tag_name: ${{ steps.check_tag.outputs.tag }}
54+ tag_name : ${{ env.TAG }}
55+ body : |
56+ :gem: released new version ${{ env.TAG }}
57+ draft : false
58+ prerelease : false
59+ env :
60+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments