Skip to content

Commit 7ac6e13

Browse files
committed
add release action
1 parent 5c6807f commit 7ac6e13

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

.github/workflows/release.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags (v1.0.0, v1.2.3, etc.)
7+
8+
jobs:
9+
build:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build package
27+
run: npm run build
28+
29+
- name: Get version from tag
30+
id: get_version
31+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
32+
33+
- name: Create GitHub Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ github.ref }}
40+
release_name: Release ${{ github.ref_name }}
41+
draft: false
42+
prerelease: false
43+
body: |
44+
Release of applescript-mcp version ${{ steps.get_version.outputs.VERSION }}
45+
46+
## Changes
47+
48+
<!-- Add your release notes here -->
49+
50+
- name: Create package archive
51+
run: |
52+
mkdir -p dist-package
53+
cp -r dist package.json README.md LICENSE dist-package/
54+
cd dist-package
55+
npm pack
56+
mv *.tgz ../applescript-mcp-${{ steps.get_version.outputs.VERSION }}.tgz
57+
58+
- name: Upload Release Asset
59+
uses: actions/upload-release-asset@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
upload_url: ${{ steps.create_release.outputs.upload_url }}
64+
asset_path: ./applescript-mcp-${{ steps.get_version.outputs.VERSION }}.tgz
65+
asset_name: applescript-mcp-${{ steps.get_version.outputs.VERSION }}.tgz
66+
asset_content_type: application/gzip
67+
68+
# Uncomment the following step if you want to publish to npm
69+
# - name: Publish to npm
70+
# run: npm publish
71+
# env:
72+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)