This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
v3.0.0 #2
Workflow file for this run
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: Publish neste | |
on: | |
release: | |
types: | |
- released | |
- prereleased | |
jobs: | |
pack_package: | |
runs-on: ubuntu-latest | |
name: Publish neste | |
env: | |
PACKAGE_VERSION: ${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v4 | |
name: Code checkout | |
- uses: actions/setup-node@v4 | |
name: Setup node.js | |
with: | |
node-version: 18.x | |
registry-url: https://registry.npmjs.org/ | |
- name: Edit version and install depencies | |
run: | | |
sudo npm i -g semver | |
VERSION="$(semver -c ${{ github.ref_name }})" | |
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV | |
jq --arg ver $VERSION '.version = $ver' package.json > package2.json | |
mv -fv package2.json package.json | |
# Install depencides and build | |
npm install --no-save | |
# Publish npm | |
- run: npm publish --access public --tag ${{ github.event.release.prerelease && 'next' || 'latest' }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} |