-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.15 KB
/
publish.yml
File metadata and controls
84 lines (72 loc) · 2.15 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
name: Publish
on:
workflow_dispatch:
push:
tags:
- "*"
permissions:
contents: write
jobs:
publish-all:
name: Publish all packages
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Release message
if: github.ref_type == 'tag'
run: |
MESSAGE=$(git tag -l --format='%(contents)' "${GITHUB_REF_NAME}")
echo "$MESSAGE" >> release-message.txt
cat release-message.txt
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Setup Turbo
id: setup
run: |
pkgNames=()
pkgDirs=($(ls -d ./packages/*/))
for i in "${pkgDirs[@]}"; do
dirname=$(basename "$i")
if [ "$dirname" == "cli" ]; then
continue
else
pkgNames+=("@storybooker/$dirname")
fi
done
npx -y turbo prune storybooker ${pkgNames[@]}
cp tsconfig.base.json out/tsconfig.base.json
cp .oxlintrc.json out/.oxlintrc.json
cp -R scripts out/scripts
- name: Install dependencies
working-directory: ./out
run: yarn install --immutable
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Verify
working-directory: ./out
run: npx turbo verify
- name: Publish on JSR - Core
working-directory: ./out/packages/core
continue-on-error: true
run: npx -y jsr publish --token ${{ secrets.JSR_API_TOKEN }} --allow-slow-types
- name: Publish on NPM
working-directory: ./out
run: yarn publish:npm
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Create GitHub Release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
body_path: release-message.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}