Skip to content

Commit 15cd210

Browse files
authored
Merge pull request #10 from opf/impl/66324-automatic-release-on-new-version
automatically create a new release when a new version is merged to thee main branch
2 parents 54a6dc2 + 5ef22fa commit 15cd210

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

.github/workflows/tag-version.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tag Version
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
tag-version:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0 # fetch all tags
19+
20+
- name: Tag and push if new version
21+
run: |
22+
VERSION=$(jq -r .version package.json)
23+
TAG="v$VERSION"
24+
if git rev-parse "$TAG" >/dev/null 2>&1; then
25+
echo "Tag $TAG already exists. No action taken."
26+
else
27+
git config user.name "github-actions[bot]"
28+
git config user.email "github-actions[bot]@users.noreply.github.com"
29+
git tag "$TAG"
30+
git push origin "$TAG"
31+
echo "Tag $TAG created and pushed."
32+
fi

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44

55
## Usage
66

7+
### Installation
8+
9+
Include the following entry to your _package.json_.
10+
11+
```json
12+
"op-blocknote-extensions": "github:opf/op-blocknote-extensions#<VERSION>"
13+
```
14+
15+
### Implementation
16+
717
First setup a blocknote schema with additional blocks offered by this library...
818

919
```jsx
@@ -81,8 +91,6 @@ This should make sure that the package is available for OpenProject even if runn
8191

8292
### Releases
8393

84-
Releases and versioning are not implemented yet. For now the way to use this library is by including the following entry directly to the _package.json_ of your application.
94+
Updating the version field in package.json will automatically create a new Git tag with the corresponding version. Pushing this tag to the repository triggers the generation of a new release.
8595

86-
```json
87-
"op-blocknote-extensions": "github:opf/op-blocknote-extensions"
88-
```
96+
To publish a new release, simply update the version in package.json and merge the changes into the main branch.

0 commit comments

Comments
 (0)