-
Notifications
You must be signed in to change notification settings - Fork 1.8k
87 lines (77 loc) · 2.72 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
name: Release
on:
push:
tags:
# Push events to matching v*, i.e. v1.0, v20.15.10
- 'v*'
# Ignore tags for v10, there is a separate v10-release.yml workflow for v10
- '!v10*'
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
timeout-minutes: 60
# Needed as recommended by npm docs on publishing with provenance https://docs.npmjs.com/generating-provenance-statements
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js 20.x
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --immutable --immutable-cache --check-cache
# For generating playwright json report for avt tests
- name: Install browsers
run: yarn playwright install --with-deps
- name: Build project
run: yarn build
# Additional steps for generating playwright json report for avt tests
- name: Build storybook
run: yarn workspace @carbon/react storybook:build
- name: Run storybook
id: storybook
run: |
npx serve -l 3000 packages/react/storybook-static &
pid=$!
echo ::set-output name=pid::"$pid"
- uses: ./actions/wait-for-it
with:
URL: 'http://localhost:3000'
timeout-minutes: 3
- name: Run AVT
if: github.repository == 'carbon-design-system/carbon'
run: |
yarn playwright test --project chromium --grep @avt
- name: Stop storybook
run: kill ${{ steps.storybook.outputs.pid }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a #4.3.6
with:
name: playwright-avt-report
path: .playwright
- name: Run Continuous Integration checks
run: yarn ci-check
- name: Publish packages under the `next` dist tag
run:
yarn lerna publish from-package --dist-tag next --no-verify-access
--yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release
id: create_release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
with:
script: |
github.rest.repos.createRelease({
tag_name: context.ref,
name: '${{ github.ref_name }}',
draft: false,
prerelease: true,
owner: context.repo.owner,
repo: context.repo.repo,
})