forked from notargs/UnityNaturalMCP
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (55 loc) · 2.13 KB
/
version-bump.yml
File metadata and controls
69 lines (55 loc) · 2.13 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
name: Create Version Bump PR
on:
workflow_dispatch:
inputs:
version:
description: 'Version to bump to (e.g., 1.0.1, 1.1.0, 2.0.0)'
required: true
type: string
jobs:
create-version-pr:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Create version bump branch
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -b "version-bump-${{ github.event.inputs.version }}"
- name: Update version
run: |
cd UnityNaturalMCPServer
npm version ${{ github.event.inputs.version }} --no-git-tag-version
- name: Commit changes
run: |
git add UnityNaturalMCPServer/package.json
git commit -m "chore: bump version to ${{ github.event.inputs.version }}"
- name: Push branch
run: git push origin "version-bump-${{ github.event.inputs.version }}"
- name: Create Pull Request
uses: actions/github-script@v7
with:
script: |
const { data: pr } = await github.rest.pulls.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `chore: bump version to ${{ github.event.inputs.version }}`,
head: `version-bump-${{ github.event.inputs.version }}`,
base: 'main',
body: `## Version Bump to ${{ github.event.inputs.version }}
This PR updates the package version to ${{ github.event.inputs.version }}.
**Changes:**
- Updated \`UnityNaturalMCPServer/package.json\` version
- Updated \`UnityNaturalMCPServer/package-lock.json\`
Once merged, this will automatically trigger the release workflow.
/cc @${{ github.actor }}`
});
console.log(`Created PR #${pr.number}: ${pr.html_url}`);