-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.42 KB
/
Copy pathrelease.yml
File metadata and controls
98 lines (81 loc) · 2.42 KB
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
name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
pages: write
id-token: write
jobs:
release:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Set version from tag in all packages
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
for pkg in packages/*; do
if [ -f "$pkg/package.json" ]; then
npm version --no-git-tag-version --workspace="$pkg" "$TAG_VERSION"
fi
done
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Run tests
run: npm test
- name: Publish all packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
for pkg in packages/*; do
if [ -f "$pkg/package.json" ]; then
cd "$pkg"
npm publish --access public --provenance
cd -
fi
done
- name: Add package.json changes to git
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add packages/*/package.json
git commit -m "chore: set version to $TAG_VERSION"
git tag -f "v$TAG_VERSION"
git push origin HEAD:refs/heads/main --follow-tags
git push origin -f "v$TAG_VERSION"
storybook:
needs: release
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Build packages
run: npm run build
- name: Build Storybook
run: npm run build-storybook -w packages/ui
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/ui/storybook-static
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4