From aadf56fe72b811e85a6800ffb6450fd1ce7bffec Mon Sep 17 00:00:00 2001 From: Taylor Price Date: Wed, 26 Jun 2024 14:05:19 -0700 Subject: [PATCH] chore: add back dispatch jobs Signed-off-by: Taylor Price --- .github/workflows/dispatch.yaml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/dispatch.yaml diff --git a/.github/workflows/dispatch.yaml b/.github/workflows/dispatch.yaml new file mode 100644 index 0000000..0236a51 --- /dev/null +++ b/.github/workflows/dispatch.yaml @@ -0,0 +1,37 @@ +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 }} + VERSION="${TAG#v}" + sed -i 's/version = ".*"/version = "'${VERSION}'"/' pyproject.toml + sed -i 's/"version": "v.*"/"version": "'${TAG}'"/' gptscript/install.py + sed -i 's/"version": "v.*"/"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' + tagging_message: ${{ github.event.client_payload.tag }} + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ github.event.client_payload.tag }} + name: Release ${{ github.event.client_payload.tag }} + generateReleaseNotes: true + prerelease: ${{ contains(github.event.client_payload.tag, '-rc') }}