Skip to content

fix: use optimizeDeps for @nostr-binding/sdk (#17) #4

fix: use optimizeDeps for @nostr-binding/sdk (#17)

fix: use optimizeDeps for @nostr-binding/sdk (#17) #4

Workflow file for this run

name: Publish SDK on Tag
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
jobs:
build-and-publish:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all tags and branches
- name: Set up git configuration
run: |
git fetch --tags --prune --unshallow
git checkout ${{ github.ref }} # Ensure HEAD is on the correct tag
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v4
name: Install -g pnpm
with:
version: 9
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-path-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i
- name: Build
run: pnpm -r --filter sdk run build
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: pnpm -r --filter sdk publish --access public --no-git-checks