-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (56 loc) · 1.87 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish to NPM
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build 🔧
run: npm ci && npm run build
- name: Configure Git Identity
run: |
git config --global user.email "contact@dibodev.com"
git config --global user.name "Bot"
- name: Increase package version ↗️
run: |
npm version patch -m "🤖 Bump version to %s"
git add .
git commit -m "🤖 Bump version to %s" || echo "No changes to commit"
git remote set-url origin https://${{ secrets.ACCESS_TOKEN }}@github.com/Leoglme/node-nlp-typescript.git
git push
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Create Release Tag 🏷️
id: create_tag
run: |
VERSION=$(node -p "require('./package.json').version")
git push --tags
echo "version=v$VERSION" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Create GitHub Release 🏷️
uses: softprops/action-gh-release@v1
with:
name: ${{steps.create_tag.outputs.version}}
generate_release_notes: true
tag_name: ${{steps.create_tag.outputs.version}}
body: 'Release ${{steps.create_tag.outputs.version}}'
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Publish package on NPM 📦
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}