Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

feat: updating value plutus type #51

feat: updating value plutus type

feat: updating value plutus type #51

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:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: yarn ci
check-version:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
outputs:
version-updated: ${{ steps.compare-versions.outputs.version-updated }}
steps:
- name: Checkout main branch at commit before merge
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Get package version from main branch before merge
id: pre-merge-version
run: |
PRE_MERGE_VERSION=$(node -p "require('./package.json').version")
echo "pre_merge_version=$PRE_MERGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Checkout main branch at commit after merge
uses: actions/checkout@v4
with:
ref: 'main'
- name: Get package version from main branch after merge
id: post-merge-version
run: |
POST_MERGE_VERSION=$(node -p "require('./package.json').version")
echo "post_merge_version=$POST_MERGE_VERSION" >> "$GITHUB_OUTPUT"
- name: Compare versions
id: compare-versions
run: |
if [[ "${{ steps.pre-merge-version.outputs.pre_merge_version }}" != "${{ steps.post-merge-version.outputs.post_merge_version }}" ]]; then
echo "version-updated=true" >> "$GITHUB_OUTPUT"
else
echo "version-updated=false" >> "$GITHUB_OUTPUT"
fi
publish-npm:
needs: [build, check-version]
if: needs.check-version.outputs.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/
- run: yarn ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}