File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : bump and release
2+ on :
3+ workflow_call :
4+ inputs :
5+ workflow_file :
6+ description : " Optional workflow file to run with gh workflow"
7+ required : false
8+ type : string
9+ branch :
10+ description : " Optional git branch to pass to autotag"
11+ required : false
12+ type : string
13+ prefix :
14+ description : " prefix semver with a string"
15+ required : false
16+ type : string
17+ jobs :
18+ bump-release :
19+ runs-on : ubuntu-24.04
20+ steps :
21+ - name : Checkout
22+ uses : " actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8" # v6
23+ with :
24+ fetch-depth : 0
25+
26+ - name : install autotag binary
27+ run : |
28+ gh release download "$TAG" --repo "$REPO" --pattern "$BINARY"
29+ echo "$SHA256 $BINARY" | shasum -a 256 -c
30+
31+ chmod +x "$BINARY"
32+ sudo mv "$BINARY" /usr/bin/autotag
33+ env :
34+ REPO : autotag-dev/autotag
35+ BINARY : autotag_linux_amd64
36+ TAG : v1.4.3
37+ SHA256 : 85e7ec97d732800bb838085fd3f2e19b2aa2ee3a8da0db7fd0aaf4113a279f3a
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+
40+ - name : Bump git tag and create GitHub Release
41+ run : |-
42+ if [ "${{ inputs.branch }}" = "" ]; then
43+ TAG=$(autotag)
44+ git tag "${{ inputs.prefix }}$TAG" || echo continue
45+ else
46+ TAG=$(autotag -b "${{ inputs.branch }}")
47+ fi
48+ git push origin "${{ inputs.prefix }}$TAG"
49+ gh release create "${{ inputs.prefix }}$TAG" --title "${{ inputs.prefix }}$TAG" --generate-notes
50+ if [ "${{ inputs.workflow_file }}" != "" ]; then
51+ gh workflow run ${{ inputs.workflow_file }} --ref "${{ inputs.prefix }}$TAG"
52+ fi
53+ env :
54+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments