Skip to content

Commit f306ec7

Browse files
authored
Merge pull request #8 from patbil/github
feat: automatic deploy on npm
2 parents acb74ce + 0318da9 commit f306ec7

1 file changed

Lines changed: 29 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
11
name: Release
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
push:
5+
branches:
6+
- main
77

88
jobs:
9-
release:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
14-
with:
15-
node-version: '20'
16-
- run: npm ci
17-
- name: Setup Git user
18-
run: |
19-
git config --global user.name "Patryk Bilski"
20-
git config --global user.email "patrykb-97@wp.pl"
21-
- run: npx standard-version
22-
- run: npm publish
23-
env:
24-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: '20'
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: npm ci
22+
- name: Setup Git user
23+
run: |
24+
git config --global user.name "Patryk Bilski"
25+
git config --global user.email "patrykb-97@wp.pl"
26+
- run: npx standard-version
27+
- name: Push changes and tags
28+
run: |
29+
git push --follow-tags origin main
30+
- run: npm run build
31+
- run: npm publish
32+
working-directory: ./dist
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)