-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (55 loc) · 1.93 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (55 loc) · 1.93 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: false
jobs:
github-release:
name: Publish GitHub Release
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.32.1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Verify tag matches package versions
env:
RELEASE_TAG: ${{ github.ref_name }}
run: |
TAG_VERSION="${RELEASE_TAG#v}"
PACKAGE_VERSION="$(node -e "const versions = ['packages/shared/package.json', 'packages/ink-renderer/package.json', 'packages/ui/package.json', 'packages/agent/package.json', 'packages/tools/package.json'].map(path => require('./' + path).version); const unique = [...new Set(versions)]; if (unique.length !== 1) { console.error('Package versions differ:', versions.join(', ')); process.exit(1); } process.stdout.write(unique[0]);")"
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Tag version $TAG_VERSION does not match package version $PACKAGE_VERSION"
exit 1
fi
- name: Run release check
run: pnpm release:check
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
echo "Release $RELEASE_TAG already exists"
exit 0
fi
gh release create "$RELEASE_TAG" \
--title "$RELEASE_TAG" \
--generate-notes