Skip to content

Commit 525c56c

Browse files
committed
chore: bump package version automatically when gptscript is released
Signed-off-by: Taylor Price <[email protected]>
1 parent a3e706f commit 525c56c

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

.github/workflows/dispatch.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update GPTScript Version
2+
on:
3+
repository_dispatch:
4+
types: release
5+
6+
jobs:
7+
update-gptscript-dep:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Install jq
12+
uses: dcarbone/[email protected]
13+
- name: Update GPTScript Version
14+
run: |
15+
jq '.version = "${{ github.event.client_payload.tag }}"' package.json > temp.json && mv temp.json package.json
16+
sed -i 's/version: "v[0-9.]*"/version: "${{ github.event.client_payload.tag }}"/' scripts/install-binary.js
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 21
20+
- name: Update Lock
21+
run: npm i --package-lock-only
22+
- uses: stefanzweifel/git-auto-commit-action@v5
23+
with:
24+
commit_message: Automated GPTScript Version Update
25+
file_pattern: 'package*.json src/install-binary.js'
26+
tag-release:
27+
needs: update-gptscript-dep
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Bump version and push tag
32+
id: tag_version
33+
uses: mathieudutour/[email protected]
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
custom_tag: ${{ github.event.client_payload.tag }}
37+
tag_prefix: ""
38+
- name: Create a GitHub release
39+
uses: ncipollo/release-action@v1
40+
with:
41+
tag: ${{ steps.tag_version.outputs.new_tag }}
42+
name: Release ${{ steps.tag_version.outputs.new_tag }}
43+
body: ${{ steps.tag_version.outputs.changelog }}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)