-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (53 loc) · 1.76 KB
/
Copy pathpublish.yml
File metadata and controls
57 lines (53 loc) · 1.76 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
name: Publish
on:
push:
tags:
- "v-release"
concurrency:
group: publish
cancel-in-progress: false
permissions:
contents: read
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
# Node 26 以降は corepack が同梱されないため、先に明示的にインストールする
- name: Install Corepack
run: npm install -g corepack
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 26
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: yarn build
- name: Determine dist-tag
id: dist-tag
run: |
VERSION=$(node -e "console.log(require('./packages/@d-zero/shared/package.json').version)")
if [[ "$VERSION" == *"-alpha"* ]]; then
echo "tag=alpha" >> "$GITHUB_OUTPUT"
elif [[ "$VERSION" == *"-beta"* ]]; then
echo "tag=beta" >> "$GITHUB_OUTPUT"
elif [[ "$VERSION" == *"-rc"* ]]; then
echo "tag=rc" >> "$GITHUB_OUTPUT"
elif [[ "$VERSION" == *"-"* ]]; then
echo "tag=next" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- name: Publish
run: npx lerna publish from-package --dist-tag ${{ steps.dist-tag.outputs.tag }} --yes
- name: Publish (retry on transient sigstore 409)
if: failure()
run: npx lerna publish from-package --dist-tag ${{ steps.dist-tag.outputs.tag }} --yes