-
Notifications
You must be signed in to change notification settings - Fork 9
49 lines (48 loc) · 1.69 KB
/
dispatch.yaml
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
name: Update GPTScript Version
on:
repository_dispatch:
types: release
jobs:
update-gptscript-dep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GH_TOKEN }}
- name: Update GPTScript Version
run: |
TAG=${{ github.event.client_payload.tag }}
echo "${TAG#v}" >> $VERSION
sed -i 's/version = "[0-9.]*"/version = "'${VERSION}'"/' pyproject.toml
sed -i 's/"version": "v[0-9.]*"/"version": "'${TAG}'"/' gptscript/install.py
sed -i 's/"version": "v[0-9.]*"/"version": "'${TAG}'"/' scripts/package
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install deps
run: |
pip install -r requirements.txt
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated GPTScript Version Update
file_pattern: 'pyproject.toml gptscript/install.py scripts/package'
tag-release:
needs: update-gptscript-dep
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BOT_GH_TOKEN }}
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.BOT_GH_TOKEN }}
custom_tag: ${{ github.event.client_payload.tag }}
tag_prefix: ""
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}