-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (54 loc) · 1.81 KB
/
release-patch.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
name: Release patch Workflow
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run && github.event.workflow_run.conclusion == 'success' || true }}
environment: 'Release NPM'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_USER: ${{ vars.GIT_USER }}
GIT_EMAIL: ${{ vars.GIT_EMAIL }}
RELEASE_BRANCH: ${{ github.event.workflow_run.head_branch || github.ref }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ env.GH_TOKEN }}
ref: ${{ env.RELEASE_BRANCH }}
submodules: recursive
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Auth NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
npm whoami
- name: Auth Git
run: |
git config user.email "${{ env.GIT_EMAIL }}"
git config user.name "${{ env.GIT_USER }}"
- name: Install Deps
run: npm ci
- name: Build packages
run: npx nx run-many --target=build --all --parallel=2 --exclude testfront,storybook,storefront
- name: Fix js extension
run: node tools/post-build/add-js-extension.js
- name: Fix d.ts files
run: node tools/post-build/fix-dts-paths.js
- name: Release patch
if: ${{ startsWith(env.RELEASE_BRANCH, 'refs/heads/release/') }}
run: npm run release-patch
- name: Release labs
run: npm run release-labs
- name: Release Error Log
if: failure()
run: cat libs/lerna-debug.log