mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 00:18:19 +01:00
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: Build & Publish Package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
# For provenance generation
|
|
id-token: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
environment: NPM Deploy
|
|
if: contains(github.event.head_commit.message, '[publish')
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: oven-sh/setup-bun@v2
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
- name: Build
|
|
run: bun install && bun run build
|
|
|
|
- name: Publish Federation to NPM
|
|
if: contains(github.event.head_commit.message, '(federation)')
|
|
run: cd federation && npm publish --provenance --tag ${{ contains(github.event.head_commit.message, '[publish nightly]') && 'nightly' || 'latest' }} --access public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Publish Federation to JSR
|
|
if: contains(github.event.head_commit.message, '(federation)')
|
|
run: cd federation && bunx jsr publish --allow-slow-types --allow-dirty
|
|
|
|
- name: Publish Client to NPM
|
|
if: contains(github.event.head_commit.message, '(client)')
|
|
run: cd client && npm publish --provenance --tag ${{ contains(github.event.head_commit.message, '[publish nightly]') && 'nightly' || 'latest' }} --access public
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Publish Client to JSR
|
|
if: contains(github.event.head_commit.message, '(client)')
|
|
run: cd client && bunx jsr publish --allow-slow-types --allow-dirty
|