Skip to content

Commit

Permalink
chore: npm release script
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Oct 20, 2023
1 parent 8b6b0b9 commit c9eccde
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish prerelease to NPM
name: Javascript-library - Publish prerelease to NPM

on:
# Allows you to run this workflow manually from the Actions tab
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Javascript-library - Publish release to NPM

on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:


publish-prerelease:
name: Publish to NPM
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Javascript library - Install
working-directory: ./lib/javascript-library
run: yarn install
env:
CI: true
- name: Javascript library - Build
working-directory: ./lib/javascript-library
run: yarn build
env:
CI: true
- name: Publish to NPM
working-directory: ./lib/javascript-library
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
NEW_VERSION=$(node -p "require('./package.json').version")
yarn publish --access=public --new-version=$NEW_VERSION --network-timeout 100000 --tag latest
env:
CI: true

0 comments on commit c9eccde

Please sign in to comment.