Skip to content

feat(backend): payment-streams endpoint (#478) #1

feat(backend): payment-streams endpoint (#478)

feat(backend): payment-streams endpoint (#478) #1

name: Publish types-bundle to npm.js
on:
push:
branches: [main]
paths:
- 'types-bundle/**'
workflow_dispatch:
inputs:
sha:
description: Full SHA to build the pnpm package from
required: true
dry_run:
description: Perform a dry run (no actual publish)
type: boolean
required: false
default: false
jobs:
publish-types-bundle:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout (manual)
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.sha }}
- name: Checkout (push)
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
- name: Setup pnpm & cache
uses: ./.github/workflow-templates/setup-pnpm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install and build types-bundle
run: |
cd types-bundle
pnpm install --no-frozen-lockfile
pnpm run build
- name: Publish to npm
if: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') }}
working-directory: types-bundle
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
echo "Publishing $PKG_NAME v$PKG_VERSION"
pnpm publish --access public --no-git-checks || {
echo "Publish failed (possibly already published). Checking registry...";
CURR=$(npm view "$PKG_NAME" version || echo "");
if [ "$CURR" = "$PKG_VERSION" ]; then
echo "Version already published. Skipping.";
exit 0;
else
echo "Unexpected publish error.";
exit 1;
fi
}
- name: Dry run note
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' }}
run: echo "Dry run enabled; skipped npm publish."