Skip to content

Add stx_signTransactions #191

Add stx_signTransactions

Add stx_signTransactions #191

name: Build and Publish NPM package
on:
pull_request:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Set `@secretkeylabs` scope to use GitHub Package Registry for package installation
run: |
echo "@secretkeylabs:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${AUTH_TOKEN}" >> .npmrc
env:
AUTH_TOKEN: ${{ secrets.GH_PACKAGE_REGISTRY_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Run CI
run: npm run ci
- id: current-version
name: Get current version
run: echo "CURRENT_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT
- id: sha
name: Get commit sha
run: echo "SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set publish version
run: npm version --no-git-tag-version $CURRENT_VERSION-$SHA
env:
SHA: ${{ steps.sha.outputs.SHA }}
CURRENT_VERSION: ${{ steps.current-version.outputs.CURRENT_VERSION }}
- name: Publish to NPM package registry
run: |
echo "@sats-connect:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=$AUTH_TOKEN" >> .npmrc
npm publish --access=public --tag pr-$PR_NUMBER
env:
AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }}
PR_NUMBER: ${{ github.event.number }}