-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (32 loc) · 1.08 KB
/
npmPublish.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
name: NPM publish workflow
on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- '.github/workflows/*' # не запускать воркфлоу при обновлении самих воркфлоу
env:
NPM_VERSION_MODIFIER: patch
NODE_VERSION: 18.11.0
jobs:
Prepare_and_publish:
runs-on: ubuntu-latest
steps:
- name: Get repository code
uses: actions/checkout@v4
- name: Setup .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_VERSION }}'
registry-url: 'https://registry.npmjs.org'
- name: Install node modules
run: yarn
- name: Clean previous build
run: yarn clean
- name: Make build
run: yarn build
- name: Go to build folder & publish new version to NPM
run: cd build && npm version --no-git-tag-version $(npm view @appklaar/codebud@latest version) && npm version --no-git-tag-version ${{ env.NPM_VERSION_MODIFIER }} && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}