Skip to content

Commit 946d7df

Browse files
authored
Merge pull request #85 from notargs/bump_version_workflow
Add bump-version workflow
2 parents a1a5dba + 52b1771 commit 946d7df

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
branches: [main]
7+
8+
jobs:
9+
release:
10+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'version-bump-')
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '18'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Extract version from package.json
29+
id: version
30+
run: echo "version=$(node -p "require('./UnityNaturalMCPServer/package.json').version")" >> $GITHUB_OUTPUT
31+
32+
- name: Create and push git tag
33+
run: |
34+
git config --local user.email "[email protected]"
35+
git config --local user.name "GitHub Action"
36+
git tag "v${{ steps.version.outputs.version }}"
37+
git push origin "v${{ steps.version.outputs.version }}"
38+
39+
- name: Create GitHub Release
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
tag_name: "v${{ steps.version.outputs.version }}"
43+
name: "Release v${{ steps.version.outputs.version }}"
44+
draft: false
45+
prerelease: false
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/version-bump.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
3838
- name: Commit changes
3939
run: |
40-
git add UnityNaturalMCPServer/package.json UnityNaturalMCPServer/package-lock.json
40+
git add UnityNaturalMCPServer/package.json
4141
git commit -m "chore: bump version to ${{ github.event.inputs.version }}"
4242
4343
- name: Push branch

0 commit comments

Comments
 (0)