Skip to content

Commit 4e616a1

Browse files
committed
ci: merge version bump and npm publish workflows
1 parent db5b7e0 commit 4e616a1

File tree

2 files changed

+30
-38
lines changed

2 files changed

+30
-38
lines changed

.github/workflows/auto-version-bump.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/npm-publish.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
name: NPM publish
22
on:
3-
workflow_call:
3+
pull_request:
4+
types: [ closed ]
5+
branches: ['develop']
6+
47
jobs:
5-
build:
8+
version-bump:
9+
name: 'Bump version and commit package.json'
10+
runs-on: ubuntu-latest
11+
environment: production
12+
if: github.event.pull_request.merged == true
13+
steps:
14+
- name: 'Checkout source code'
15+
uses: 'actions/checkout@v4'
16+
with:
17+
token: ${{ secrets.BOT_USER_TOKEN }}
18+
ref: 'develop'
19+
20+
- name: 'Automated Version Bump'
21+
id: version-bump
22+
uses: 'phips28/gh-action-bump-version@master'
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.BOT_USER_TOKEN }}
25+
with:
26+
patch-wording: '[npm release]'
27+
tag-prefix: 'v'
28+
target-branch: 'develop'
29+
30+
npm-publish:
631
name: 'npm publish'
32+
needs: version-bump
33+
if: startsWith(github.event.pull_request.title, '[npm publish]')
734
runs-on: ubuntu-latest
835
environment: production
936
permissions:
@@ -16,7 +43,7 @@ jobs:
1643
ref: develop
1744

1845
- name: 'Show current version'
19-
run: grep '"version"' package.json
46+
run: grep '"version"' package.json
2047

2148
- name: Setup Node.js environment
2249
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)