Skip to content

Commit d3d4bef

Browse files
authored
Create publish.yml
1 parent 1016d46 commit d3d4bef

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
permissions: write-all
6+
7+
jobs:
8+
9+
publish-npm:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 18
16+
cache: 'npm'
17+
- run: echo "NPM_PACKAGE_VERSION=$(npm version patch --no-git-tag-version)" | tee -a $GITHUB_ENV
18+
- run: git add package.json package-lock.json
19+
- name: Update README.md with new version
20+
run: |
21+
sed -i "s|\(uses: forproxyband/vector-code-map@\)v[0-9.]*|\1${{ NPM_PACKAGE_VERSION }}|g" README.md
22+
- run: git add README.md
23+
- run: |
24+
git tag -a ${NPM_PACKAGE_VERSION} -m "Add tag ${NPM_PACKAGE_VERSION}"
25+
git push origin ${NPM_PACKAGE_VERSION}
26+
git commit -m "Set version ${NPM_PACKAGE_VERSION} by ${GITHUB_ACTOR}"
27+
git push -u origin main
28+
env:
29+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)