Skip to content

Publish next

Publish next #35

Workflow file for this run

name: 'Publish next'
on:
workflow_run:
workflows: ['CI']
types:
- completed
branches: [master]
workflow_dispatch:
permissions:
id-token: write
jobs:
build:
name: Build & Release
runs-on: ubuntu-22.04
if: github.event_name == 'workflow_dispatch' || (github.event.workflow_run.conclusion == 'success')
env:
changes: true
steps:
- uses: actions/checkout@v4.1.7
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" directory
id: check_changes
run: |
if git diff --name-only HEAD^ HEAD | grep -qE '^packages'; then
echo "changes=true" >> $GITHUB_ENV
else
echo "changes=false" >> $GITHUB_ENV
fi
if: github.event_name == 'workflow_run'
- uses: actions/setup-node@v4.0.2
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
if: env.changes == 'true'
- uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
if: env.changes == 'true'
- name: Build
run: yarn --skip-integrity-check --network-timeout 100000
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9
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'