chore: simplify steps

This commit is contained in:
Enrico Sacchetti 2024-01-12 12:36:10 -05:00
commit bfacced137

View file

@ -4,8 +4,7 @@ on:
- "v*" - "v*"
jobs: jobs:
build-stable: build:
if: ${{ ! contains(github.ref, '-next') }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
@ -16,36 +15,23 @@ jobs:
with: with:
node-version: "18.x" node-version: "18.x"
registry-url: "https://registry.npmjs.org" registry-url: "https://registry.npmjs.org"
- name: Publish package - name: Build
run: |
npm install --force
npm run build:docs & npm run build:lib
- name: Publish package (stable)
if: ${{ ! contains(github.ref, '-next') }}
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# Currently, only npm supports publishing packages with provenance # Currently, only npm supports publishing packages with provenance
# https://docs.npmjs.com/generating-provenance-statements # https://docs.npmjs.com/generating-provenance-statements
run: | run: |
npm install --force
npm run build:docs & npm run build:lib
npm publish --provenance --access public npm publish --provenance --access public
- name: Publish package (next)
# Publish with `next` tag if: ${{ contains(github.ref, '-next') }}
build-next:
if: ${{ contains(github.ref, '-next') }}
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Publish package
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# Currently, only npm supports publishing packages with provenance
# https://docs.npmjs.com/generating-provenance-statements
run: | run: |
npm install --force npm install --force
npm run build:docs & npm run build:lib npm run build:docs & npm run build:lib