Skip to content

Release

Release #11

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test --workspace=httpsig
- run: npm test --workspace=better-auth
- run: npm test --workspace=email-verification
publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm install -g npm@latest
- run: npm ci
- run: npm run build
- name: Publish packages with provenance
run: |
npx lerna ls --json --no-private | jq -r '.[] | "\(.name) \(.version) \(.location)"' | while read name version location; do
published=$(npm view "$name" version 2>/dev/null || echo "0.0.0")
if [ "$version" != "$published" ]; then
echo "Publishing $name@$version (npm has $published)..."
cd "$location"
npm publish --provenance --access public
cd "$GITHUB_WORKSPACE"
else
echo "Skipping $name@$version (already published)"
fi
done