Skip to content

Publish next

Publish next #50

Workflow file for this run

name: 'Publish next'
on:
workflow_run:
workflows: ['CI']
types:
- completed
branches: ['main']
workflow_dispatch:
permissions:
id-token: write
jobs:
publish:
name: Build & Publish
runs-on: ubuntu-latest
timeout-minutes: 60
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success')
env:
changes: true
steps:
- uses: actions/[email protected]
with:
# To fetch all history for all branches and tags.
# Required for lerna to determine the version of the next package.
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_commit.id || github.sha }}
- name: Check for changes in "packages" or "examples" directory
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -qE '^(packages|examples)'; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
if: github.event_name == 'workflow_run'
- uses: actions/[email protected]
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
if: env.changes == 'true'
- name: Build
run: yarn --skip-integrity-check --network-timeout 100000
if: env.changes == 'true'
- name: Publish NPM
run: yarn publish:next
env:
NPM_CONFIG_PROVENANCE: 'true'
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
if: env.changes == 'true'