-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (38 loc) · 1.3 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
33
34
35
36
37
38
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: Test package
run: yarn run test
- name: Clean previous build
run: yarn clean
- name: Make build
run: yarn build
- name: Update build TS Declaration file
run: cp ./index.d.ts ./build
- name: Update build GitHub README.md file
run: cp ./README.md ./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 }}