Skip to content

feat: fixing typos

feat: fixing typos #33

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
pull_request:
types:
- closed
branches:
- master
jobs:
check-version:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
core-version-updated: ${{ steps.compare-versions.outputs.version-updated }}
steps:
- name: Checkout master branch at commit before merge
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Get package version from master branch before merge
id: pre-merge-version
run: |
cd packages/sidan-csl-rs
CORE_PRE_MERGE_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
echo "core_pre_merge_version=$CORE_PRE_MERGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Checkout master branch at commit after merge
uses: actions/checkout@v4
with:
ref: "master"
- name: Get package version from master branch after merge
id: post-merge-version
run: |
cd packages/sidan-csl-rs
CORE_POST_MERGE_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')
echo "core_post_merge_version=$CORE_POST_MERGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Compare versions
id: compare-versions
run: |
if [[ "${{ steps.pre-merge-version.outputs.core_pre_merge_version }}" != "${{ steps.post-merge-version.outputs.core_post_merge_version }}" ]]; then
echo "core-version-updated=true" >> "$GITHUB_OUTPUT"
else
echo "core-version-updated=false" >> "$GITHUB_OUTPUT"
fi
publish-npm:
needs: [check-version]
if: needs.check-version.outputs.core-version-updated == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install && cargo install wasm-pack
- run: npm run js:publish-nodejs && npm run js:publish-browser
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}