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 : Build to "release" branch
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.ref_name }}
10+ cancel-in-progress : true
11+
12+ jobs :
13+ release :
14+ name : " Update release branch"
15+ uses : humanmade/hm-github-actions/.github/workflows/build-and-release-node.yml@a9a243d6c42fbff4a967d7ce0a6b307bc77251b7 # v0.1.0
16+ with :
17+ node_version : 24
18+ source_branch : main
19+ release_branch : release
20+ built_asset_paths : build
Original file line number Diff line number Diff line change 1+ name : Tag and Release
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Version tag (e.g., v1.0.0)'
8+ required : true
9+ target_branch :
10+ description : ' Branch to tag (e.g., release)'
11+ default : release
12+ required : true
13+
14+ jobs :
15+ tag_and_release :
16+ name : Tag and Release
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : Checkout repository
21+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
23+ - name : Check if tag already exists
24+ id : check_tag
25+ run : |
26+ if git rev-parse "refs/tags/${{ github.event.inputs.version }}" >/dev/null 2>&1; then
27+ echo "Tag already exists"
28+ echo "tag_exists=true" >> "$GITHUB_OUTPUT"
29+ fi
30+
31+ - name : Abort if tag exists
32+ if : steps.check_tag.outputs.tag_exists == 'true'
33+ run : exit 1
34+
35+ - name : Create and push tag
36+ run : |
37+ git config user.name "github-actions[bot]"
38+ git config user.email "github-actions[bot]@users.noreply.github.com"
39+ git fetch origin ${{ github.event.inputs.target_branch }}
40+ git checkout ${{ github.event.inputs.target_branch }}
41+ git tag ${{ github.event.inputs.version }}
42+ git push origin ${{ github.event.inputs.version }}
43+
44+ - name : Create GitHub Release
45+ uses : ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0
46+ with :
47+ tag : ${{ github.event.inputs.version }}
48+ name : ${{ github.event.inputs.version }}
49+ body : " Automated release of version ${{ github.event.inputs.version }}"
50+ draft : false
51+ prerelease : false
You can’t perform that action at this time.
0 commit comments