-
Notifications
You must be signed in to change notification settings - Fork 6
106 lines (90 loc) · 3.08 KB
/
release-cli.yml
File metadata and controls
106 lines (90 loc) · 3.08 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Release CLI
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version bump type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install dependencies
working-directory: claude-remote-control
run: pnpm install
- name: Build CLI
working-directory: claude-remote-control
run: pnpm --filter 247-cli build
- name: Bundle CLI (copy hooks and agent)
working-directory: claude-remote-control/packages/cli
run: pnpm bundle
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# For manual dispatch: bump version and create tag
- name: Bump version (manual dispatch)
if: github.event_name == 'workflow_dispatch'
working-directory: claude-remote-control/packages/cli
run: |
npm version ${{ inputs.version }} -m "chore(release): v%s"
echo "NEW_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- name: Push version bump
if: github.event_name == 'workflow_dispatch'
run: |
git push origin main
git push origin v${{ env.NEW_VERSION }}
# For tag push: extract version from tag and update package.json
- name: Get version from tag
if: github.event_name == 'push'
run: |
echo "NEW_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update package.json version
if: github.event_name == 'push'
working-directory: claude-remote-control/packages/cli
run: |
npm version ${{ env.NEW_VERSION }} --no-git-tag-version --allow-same-version
- name: Verify version before publish
working-directory: claude-remote-control/packages/cli
run: |
echo "Package version: $(node -p "require('./package.json').version")"
echo "Expected version: ${{ env.NEW_VERSION }}"
- name: Publish to npm
working-directory: claude-remote-control/packages/cli
run: npm publish --access public --provenance --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.NEW_VERSION }}
name: v${{ env.NEW_VERSION }}
generate_release_notes: true
draft: false
prerelease: false