Skip to content

Commit 497018d

Browse files
committed
feat: streamline release process and clean up scripts
- Remove redundant build:release and prebuild scripts - Inline version update into build script - Replace test workflow with production release workflow - Tag-triggered releases: git tag vX.X.X -> automatic NPM publish - Manual workflow dispatch for testing (dry-run only) - Clean, efficient single-bundling process
1 parent b9c41e3 commit 497018d

3 files changed

Lines changed: 39 additions & 109 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
inputs:
99
version:
10-
description: 'Version to release (e.g., 1.9.1)'
10+
description: 'Test version (e.g., 1.9.1-test)'
1111
required: true
1212
type: string
1313

@@ -46,70 +46,44 @@ jobs:
4646
- name: Build TypeScript
4747
run: npm run build
4848

49-
- name: Update version (if manual trigger)
50-
if: github.event_name == 'workflow_dispatch'
51-
run: |
52-
npm version ${{ github.event.inputs.version }} --no-git-tag-version
53-
git config user.name "github-actions[bot]"
54-
git config user.email "github-actions[bot]@users.noreply.github.com"
55-
git add package.json
56-
git commit -m "chore: bump version to ${{ github.event.inputs.version }}"
57-
git tag v${{ github.event.inputs.version }}
58-
git push origin main --tags
59-
60-
- name: Get version from tag
49+
- name: Get version from tag or input
6150
id: get_version
6251
run: |
6352
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
64-
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
53+
VERSION="${{ github.event.inputs.version }}"
54+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
55+
echo "IS_TEST=true" >> $GITHUB_OUTPUT
56+
echo "📝 Test version: $VERSION"
6557
else
6658
VERSION=${GITHUB_REF#refs/tags/v}
6759
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
60+
echo "IS_TEST=false" >> $GITHUB_OUTPUT
61+
echo "🚀 Release version: $VERSION"
62+
# Update package.json version for production releases
63+
npm version $VERSION --no-git-tag-version
6864
fi
6965
70-
- name: Create package tarball
66+
- name: Create package
7167
run: npm pack
7268

73-
- name: Create GitHub Release
74-
uses: softprops/action-gh-release@v1
75-
with:
76-
tag_name: v${{ steps.get_version.outputs.VERSION }}
77-
name: Release v${{ steps.get_version.outputs.VERSION }}
78-
body: |
79-
## Release v${{ steps.get_version.outputs.VERSION }}
80-
81-
### Features
82-
- Bundled AXe binary and frameworks for zero-setup UI automation
83-
- No manual installation required - works out of the box
84-
85-
### Installation
86-
```bash
87-
npm install -g xcodebuildmcp@${{ steps.get_version.outputs.VERSION }}
88-
```
89-
90-
Or use with npx:
91-
```bash
92-
npx xcodebuildmcp@${{ steps.get_version.outputs.VERSION }}
93-
```
94-
95-
### What's Included
96-
- Latest AXe binary built from [cameroncooke/axe](https://github.com/cameroncooke/axe)
97-
- All required frameworks (FBControlCore, FBDeviceControl, FBSimulatorControl, XCTestBootstrap)
98-
- Full XcodeBuildMCP functionality with UI automation support
99-
files: |
100-
xcodebuildmcp-${{ steps.get_version.outputs.VERSION }}.tgz
101-
draft: false
102-
prerelease: false
69+
- name: Test publish (dry run for manual triggers)
70+
if: github.event_name == 'workflow_dispatch'
71+
run: |
72+
echo "🧪 Testing package creation (dry run)"
73+
npm publish --dry-run --access public
10374
104-
- name: Publish to NPM
75+
- name: Publish to NPM (production releases only)
76+
if: github.event_name == 'push'
10577
run: npm publish --access public
10678
env:
10779
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10880

109-
- name: Update release with NPM link
81+
- name: Create GitHub Release (production releases only)
82+
if: github.event_name == 'push'
11083
uses: softprops/action-gh-release@v1
11184
with:
11285
tag_name: v${{ steps.get_version.outputs.VERSION }}
86+
name: Release v${{ steps.get_version.outputs.VERSION }}
11387
body: |
11488
## Release v${{ steps.get_version.outputs.VERSION }}
11589
@@ -130,7 +104,21 @@ jobs:
130104
📦 **NPM Package**: https://www.npmjs.com/package/xcodebuildmcp/v/${{ steps.get_version.outputs.VERSION }}
131105
132106
### What's Included
133-
- Latest AXe binary built from [cameroncooke/axe](https://github.com/cameroncooke/axe)
107+
- Latest AXe binary from [cameroncooke/axe](https://github.com/cameroncooke/axe)
134108
- All required frameworks (FBControlCore, FBDeviceControl, FBSimulatorControl, XCTestBootstrap)
135109
- Full XcodeBuildMCP functionality with UI automation support
136-
append_body: false
110+
files: |
111+
xcodebuildmcp-${{ steps.get_version.outputs.VERSION }}.tgz
112+
draft: false
113+
prerelease: false
114+
115+
- name: Summary
116+
run: |
117+
if [ "${{ steps.get_version.outputs.IS_TEST }}" = "true" ]; then
118+
echo "🧪 Test completed for version: ${{ steps.get_version.outputs.VERSION }}"
119+
echo "Ready for production release!"
120+
else
121+
echo "🎉 Production release completed!"
122+
echo "Version: ${{ steps.get_version.outputs.VERSION }}"
123+
echo "📦 NPM: https://www.npmjs.com/package/xcodebuildmcp/v/${{ steps.get_version.outputs.VERSION }}"
124+
fi

.github/workflows/test-release.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
"xcodebuildmcp-diagnostic": "build/diagnostic-cli.js"
1010
},
1111
"scripts": {
12-
"prebuild": "node -e \"const fs = require('fs'); const pkg = require('./package.json'); fs.writeFileSync('src/version.ts', \\`export const version = '\\${pkg.version}';\\nexport const templateVersion = '\\${pkg.templateVersion}';\\n\\`)\"",
13-
"build": "npm run prebuild && tsup",
14-
"build:watch": "npm run prebuild && tsup --watch",
12+
"build": "node -e \"const fs = require('fs'); const pkg = require('./package.json'); fs.writeFileSync('src/version.ts', \\`export const version = '\\${pkg.version}';\\nexport const templateVersion = '\\${pkg.templateVersion}';\\n\\`)\" && tsup",
13+
"build:watch": "npm run build && tsup --watch",
1514
"bundle:axe": "scripts/build-axe.sh",
16-
"build:release": "npm run bundle:axe && npm run build",
1715
"lint": "eslint 'src/**/*.{js,ts}'",
1816
"lint:fix": "eslint 'src/**/*.{js,ts}' --fix",
1917
"format": "prettier --write 'src/**/*.{js,ts}'",

0 commit comments

Comments
 (0)