Minor improvements #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Update build TS Declaration file | |
run: cp ./index.d.ts ./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 }} |