-
Notifications
You must be signed in to change notification settings - Fork 22
58 lines (50 loc) · 1.93 KB
/
prod_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
name: Production Release
on:
workflow_dispatch:
inputs:
force:
description: Force publish all packages?
type: boolean
default: false
graduate:
description: Graduate prerelease packages?
type: boolean
default: false
jobs:
publish:
name: Publish v6
environment:
name: production
url: https://ui.refinitiv.com
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# Pulls all commits (needed for Lerna)
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Configure Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "refinitiv-ui-dev"
- name: Gather resources and build
uses: ./.github/actions/checkout-install-and-build
- name: Setup command line option
shell: bash
run: |
[[ "${{ inputs.force }}" == "true" ]] && export FORCE=--force-publish || export FORCE=''
[[ "${{ inputs.graduate }}" == "true" ]] && export GRADUATE=--conventional-graduate || export GRADUATE=''
echo "FORCE_OPTION=$FORCE" >> $GITHUB_ENV
echo "GRADUATE_OPTION=$GRADUATE" >> $GITHUB_ENV
- name: Bump package versions and create GitHub release
run: npx lerna version --create-release github --conventional-commits ${{ env.FORCE_OPTION }} ${{ env.GRADUATE_OPTION }} --yes
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Publish to NPM
run: npx lerna publish from-git --dist-tag v6-lts --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Docs
run: curl -X POST "https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/${{ secrets.CF_DEPLOY_HOOKS_ID }}"