Skip to content

Commit 6feaabe

Browse files
committed
Add github workflows for build and release
1 parent 6df56e8 commit 6feaabe

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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@04c32a93e52ae987095f144105745a501d6207c8 # v0.2.0
16+
with:
17+
node_version: 24
18+
source_branch: main
19+
release_branch: release
20+
built_asset_paths: build
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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
52+
generateReleaseNotes: true
53+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)