Release 2.0.2 #4
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: Release Workflow | |
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Verify Package Version | |
run: | | |
tag_version=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///' | sed 's/^v//') | |
package_version=$(node -p "require('./package.json').version") | |
if [ "$tag_version" != "$package_version" ]; then | |
echo "Error: package.json version ($package_version) does not match tag version ($tag_version)" | |
exit 1 | |
fi | |
- name: Verify Package Lock Version | |
run: | | |
tag_version=$(echo "${{ github.ref }}" | sed 's/refs\/tags\///' | sed 's/^v//') | |
lockfile_version=$(node -p "require('./package-lock.json').version") | |
if [ "$tag_version" != "$lockfile_version" ]; then | |
echo "Error: package-lock.json version ($lockfile_version) does not match tag version ($tag_version)" | |
exit 1 | |
fi | |
- name: Build | |
run: npm run build | |
- name: Publish to NPM | |
uses: JS-DevTools/npm-publish@v2 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
access: "public" |