Skip to content

Commit d65e86d

Browse files
committed
simplified workflows
1 parent 6c6556c commit d65e86d

3 files changed

Lines changed: 15 additions & 20 deletions

File tree

.github/workflows/create-tag.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ permissions:
99
contents: write
1010

1111
env:
12-
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
13-
WANTED_MESSAGE: 'bump version to '
12+
PATTERN: '[0-9]+\.[0-9]+\.[0-9]+'
1413

1514
jobs:
1615
create:
@@ -23,21 +22,13 @@ jobs:
2322
with:
2423
token: ${{ secrets.WF_TOKEN }}
2524

26-
- name: Get new version
25+
- name: Tag new version
2726
shell: bash
2827
run: |
29-
COMMIT_MESSAGE="${{ env.COMMIT_MESSAGE }}"
30-
WANTED_MESSAGE="${{ env.WANTED_MESSAGE }}"
28+
MESSAGE="${{ github.event.head_commit.message }}"
29+
VERSION="$(echo $MESSAGE | grep -oE $PATTERN)"
3130
32-
VERSION="${COMMIT_MESSAGE/$WANTED_MESSAGE}"
33-
VERSION="${VERSION#v}"
34-
VERSION="${VERSION#V}"
31+
echo "Tagging version $VERSION"
3532
36-
echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV
37-
38-
- name: Git tag version
39-
run: |
40-
echo "Tagging version $NEW_VERSION"
41-
42-
git tag "v$NEW_VERSION"
33+
git tag "v$VERSION"
4334
git push --tags

.github/workflows/publish-version.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
1515

16+
- name: Set up PNPM
17+
uses: pnpm/action-setup@v4
18+
1619
- name: Set up Node
1720
uses: actions/setup-node@v4
1821
with:
1922
cache: 'pnpm'
2023

21-
- name: Install PNPM
22-
uses: pnpm/action-setup@v4
23-
with:
24-
run_install: true
25-
24+
- run: pnpm install
2625
- run: pnpm publish
2726
env:
2827
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"type": "git",
2323
"url": "git+https://github.com/kermage/lazyscripts.git"
2424
},
25+
"engines": {
26+
"node": ">=20",
27+
"pnpm": ">=10"
28+
},
29+
"packageManager": "pnpm@10.8.1",
2530
"type": "module",
2631
"exports": {
2732
".": {

0 commit comments

Comments
 (0)