-
Notifications
You must be signed in to change notification settings - Fork 34
215 lines (205 loc) · 7.27 KB
/
release.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Create release
on:
schedule:
# At 13:00 (UTC) every Wednesday.
- cron: '0 13 * * 3'
workflow_dispatch:
inputs:
version:
description: '⚠ be sure of yourself ⚠'
required: false
default: ''
debug:
description: 'Add DEBUG=* to the env if true'
type: boolean
default: false
required: false
jobs:
release:
environment: 'Release'
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Release
run: npm run release
env:
VERSION: ${{ inputs.version }}
DEBUG: ${{ inputs.debug && '*' || '' }}
RELEASER_APP_ID: ${{ secrets.RELEASER_APP_ID }}
RELEASER_PRIVATE_KEY: ${{ secrets.RELEASER_PRIVATE_KEY }}
RELEASER_CLIENT_ID: ${{ secrets.RELEASER_CLIENT_ID }}
RELEASER_CLIENT_SECRET: ${{ secrets.RELEASER_CLIENT_SECRET }}
RELEASER_INSTALLATION_ID: ${{ secrets.RELEASER_INSTALLATION_ID }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Call ui-kit-cd
run: node ./scripts/deploy/trigger-ui-kit-cd.mjs
env:
GH_TOKEN: ${{ secrets.UI_KIT_CD_DISPATCHER }}
npm-prod:
needs: release
environment: 'NPM Production'
runs-on: 'ubuntu-latest'
permissions:
contents: read
discussions: write
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup
- name: Promote NPM package to production
run: npm run promote:npm:latest
docs-prod:
needs: release
runs-on: ubuntu-latest
environment: 'Docs Production'
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup
- name: Notify Docs
run: npm run notify:docs
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
quantic-prod:
needs: release
runs-on: ubuntu-latest
environment: 'Quantic Production'
permissions:
contents: read
packages: write
discussions: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup
- uses: ./.github/actions/setup-sfdx
- name: Promote SFDX package to production
run: |
echo "${{ secrets.SFDX_AUTH_JWT_KEY }}" > ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
npx --no-install nx run quantic:"promote:sfdx:ci"
rm ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
env:
SFDX_AUTH_CLIENT_ID: ${{ secrets.SFDX_AUTH_CLIENT_ID }}
SFDX_AUTH_JWT_KEY: ${{ secrets.SFDX_AUTH_JWT_KEY }}
SFDX_AUTH_JWT_USERNAME: ${{ vars.SFDX_AUTH_JWT_USERNAME }}
SFDX_AUTH_JWT_KEY_FILE: ${{ vars.SFDX_AUTH_JWT_KEY_FILE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./packages/quantic
typedoc-headless:
needs: release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup
- name: Build typedoc site
run: npm run build:typedoc
working-directory: packages/headless
shell: bash
- name: Read version from package.json
id: read_version
run: |
VERSION=$(jq -r '.version' packages/headless/package.json)
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Zip documentation folder
run: |
DOCS_DIR="packages/headless/docs"
if [ ! -d "$DOCS_DIR" ]; then
echo "Documentation folder $DOCS_DIR not found."
exit 1
fi
ZIP_NAME="headless-docs-${{ env.version }}.zip"
zip -r "$ZIP_NAME" "$DOCS_DIR"
echo "Created zip file: $ZIP_NAME"
- name: Upload documentation artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: headless-docs-${{ env.version }}
path: headless-docs-${{ env.version }}.zip
typedoc-headless-react:
needs: release
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: 'release/v3'
- uses: ./.github/actions/setup
- name: Build typedoc site
run: npm run build:typedoc
working-directory: packages/headless-react
shell: bash
- name: Read version from package.json
id: read_version
run: |
VERSION=$(jq -r '.version' packages/headless-react/package.json)
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
- name: Zip documentation folder
run: |
DOCS_DIR="packages/headless-react/docs"
if [ ! -d "$DOCS_DIR" ]; then
echo "Documentation folder $DOCS_DIR not found."
exit 1
fi
ZIP_NAME="headless-react-docs-${{ env.version }}.zip"
zip -r "$ZIP_NAME" "$DOCS_DIR"
echo "Created zip file: $ZIP_NAME"
- name: Upload documentation artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
with:
name: headless-react-docs-${{ env.version }}
path: headless-react-docs-${{ env.version }}.zip
# TODO KIT-3074 Fix the publication into the GitHub Packages, and uncomment
# github-prod:
# needs: release
# runs-on: ubuntu-latest
# environment: 'GitHub Production'
# steps:
# - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
# with:
# registry-url: 'https://npm.pkg.github.com'
# node-version-file: '.nvmrc'
# - name: Publish to GitHub Packages
# run: npm run release:phase4
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DEBUG: ${{ inputs.debug && '*' || '' }}