forked from carbon-design-system/ibm-products
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (73 loc) · 2.99 KB
/
release-v1.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
name: v1 release # Builds and releases @carbon/v10 supported version of @carbon/ibm-products
on:
workflow_dispatch:
schedule:
- cron: '30 4 * * TUE' # Release every Tuesday at 4:30am EST
jobs:
Release_v1:
runs-on: ubuntu-latest
# Recommended by npm for publishing with provenance https://docs.npmjs.com/generating-provenance-statements
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # https://github.com/actions/checkout/issues/217
token: ${{ secrets.GH_TOKEN_LERNA }} # https://github.com/lerna/lerna/issues/1957
ref: 'v1'
# https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
- run: |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config user.name $GITHUB_ACTOR
- name: Setup Node.js
uses: actions/setup-node@v2 # https://github.com/actions/setup-node
with:
node-version: '20.x'
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install
run: yarn
- name: Continuous integration check (includes build)
run: yarn ci-check
# Dry run - `yarn lerna version --no-git-tag-version --no-push`
- name: Publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }}
NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }}
run:
yarn lerna publish --dist-tag v1-latest --conventional-commits
--create-release github --yes
- name: Correct security dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }}
run:
bash .github/scripts/release-disttag-update.sh packages/security
@carbon/ibm-security
- name: Correct CDAI dist-tag
env:
NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }}
run:
bash .github/scripts/release-disttag-update.sh packages/cdai
@carbon/ibm-cloud-cognitive-cdai
- name: Rename to ibm-cloud-cognitive for legacy publish
run:
yarn json -I -f packages/ibm-products/package.json -e
'this.name="@carbon/ibm-cloud-cognitive"'
- name: Update telemetry.yml project ID for legacy publish
run: sed -i -e s/495342db-5046-4ecf-85ea-9ffceb6f8cdf/9255f6e1-1b25-4ef4-8913-062ef88935c9/ packages/ibm-products/telemetry.yml
# Run yarn again after renaming package, required after move to yarn berry
- name: Install after rename
run: yarn
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Commit for legacy package
run: |
git add .
git commit -m "chore: rename package for simultaneous publish"
- name: Publish with old name
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_LERNA }}
NODE_AUTH_TOKEN: ${{ secrets.CARBON_BOT_NPM_TOKEN }}
run: yarn lerna publish from-package --dist-tag v1-latest --yes