-
Notifications
You must be signed in to change notification settings - Fork 305
81 lines (75 loc) · 2.58 KB
/
release.yaml
File metadata and controls
81 lines (75 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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