Skip to content

Commit edd6de0

Browse files
committed
CI: Add GitHub actions release and build pipelines
1 parent e8d3cae commit edd6de0

File tree

3 files changed

+78
-2
lines changed

3 files changed

+78
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build to "release" branch
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- gh-build
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref_name }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
release:
15+
name: "Update release branch"
16+
uses: humanmade/hm-github-actions/.github/workflows/build-and-release-node.yml@04c32a93e52ae987095f144105745a501d6207c8 # v0.2.0
17+
with:
18+
node_version: 24
19+
source_branch: main
20+
release_branch: release
21+
built_asset_paths: blocks/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 }}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This plugin provides a modal component with two blocks:
2323
3. Activate the plugin in WordPress
2424

2525
### For Production
26-
1. Download from the `dist` branch or release
26+
1. Download a [release bundle](https://github.com/humanmade/hm-modal-block/releases) or clone the `release` branch
2727
2. Upload to `/wp-content/plugins/hm-modal-block/`
2828
3. Activate the plugin in WordPress
2929

@@ -40,6 +40,8 @@ This plugin provides a modal component with two blocks:
4040

4141
## Development
4242

43+
If you have [nvm](https://github.com/nvm-sh/nvm) installed you can run `nvm use` in the repository root to activate the correct version of Node.
44+
4345
### Setup
4446
```bash
4547
npm install
@@ -60,7 +62,7 @@ npm start
6062

6163
- WordPress 5.8+
6264
- PHP 7.4+
63-
- Node.js 20.10+
65+
- Node.js 24+
6466

6567
## License
6668

0 commit comments

Comments
 (0)