forked from assistant-ui/assistant-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.28 KB
/
changeset.yaml
File metadata and controls
87 lines (72 loc) · 2.28 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
name: Changesets
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CI: true
jobs:
version:
name: Create Version PR
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create version PR
id: changesets
uses: changesets/action@v1
with:
commit: "chore: update versions"
title: "chore: update versions"
version: pnpm ci:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if any packages need publishing
id: check-publish
if: steps.changesets.outputs.hasChangesets == 'false'
run: |
needs_publish="false"
for pkg in packages/*/package.json; do
[ -f "$pkg" ] || continue
name=$(jq -r '.name' "$pkg")
version=$(jq -r '.version' "$pkg")
private=$(jq -r '.private // false' "$pkg")
if [ "$private" = "true" ]; then
echo "Skipping private package: $name"
continue
fi
if npm view "${name}@${version}" version 2>/dev/null | grep -q "${version}"; then
echo "✓ ${name}@${version} already published"
else
echo "✗ ${name}@${version} needs publishing"
needs_publish="true"
fi
done
echo "needsPublish=${needs_publish}" >> $GITHUB_OUTPUT
- name: Trigger npm publish
if: steps.changesets.outputs.hasChangesets == 'false' && steps.check-publish.outputs.needsPublish == 'true'
uses: actions/github-script@v7
with:
script: |
await github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'npm-publish'
});