-
Notifications
You must be signed in to change notification settings - Fork 8
77 lines (65 loc) · 2.35 KB
/
release-ui.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
name: Release UI
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * *"
push:
branches:
- main
paths:
- packages/ui/package.json
jobs:
check:
name: Check version
runs-on: ubuntu-latest
outputs:
version_changed: ${{ steps.check.outputs.version_changed }}
nightly: ${{steps.nightly.outputs.nightly }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Check nightly status
id: nightly
run: echo "nightly=${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}" >> "$GITHUB_OUTPUT"
- name: Check version
id: check
run: |
CHANGED=$(node .github/scripts/check-changed.mjs packages/ui ${{ steps.nightly.outputs.nightly }})
echo "version_changed=$CHANGED" >> "$GITHUB_OUTPUT"
publish:
runs-on: ubuntu-latest
needs: check
if: needs.check.outputs.version_changed == 'true'
env:
nightly: ${{ needs.check.outputs.nightly }}
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "yarn"
- name: Install dependencies
run: yarn install
- name: Set nightly version
if: env.nightly
run: |
VERSION=$(node .github/scripts/get-version.mjs @rbxts/centurion-ui ${{ env.nightly }})
yarn workspace @rbxts/centurion-ui version $VERSION
- name: Publish @latest
if: !env.nightly
run: yarn workspace @rbxts/centurion-ui npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish @next
if: env.nightly
run: yarn workspace @rbxts/centurion-ui npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}