Skip to content

Prepare release v5.0.1 (#1425) #770

Prepare release v5.0.1 (#1425)

Prepare release v5.0.1 (#1425) #770

Workflow file for this run

name: Release
on:
push:
branches:
- main
- v2.0.0
workflow_dispatch:
env:
FORCE_COLOR: true
permissions: {}
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' }}
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Release
run: npx ts-node --transpile-only scripts/publish.ts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
canary:
name: Publish Canary
runs-on: ubuntu-latest
if: ${{ github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs' && github.ref == 'refs/heads/main' }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Check if packages changed
id: packages_changed
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]] || git diff --name-only HEAD~1 HEAD | grep -q "^packages/"; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi
- name: Set up Node
if: steps.packages_changed.outputs.changed == 'true'
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
- name: Prepare git
if: steps.packages_changed.outputs.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git fetch
git checkout main
- name: Installation
if: steps.packages_changed.outputs.changed == 'true'
run: yarn --frozen-lockfile --prefer-offline --ignore-scripts && yarn build-packages
- name: Publish Canary release
if: steps.packages_changed.outputs.changed == 'true'
run: yarn canary