From 525c56c2b05dc67e6b127126b8d181ca738b2719 Mon Sep 17 00:00:00 2001 From: Taylor Price Date: Thu, 6 Jun 2024 14:09:43 -0700 Subject: [PATCH] chore: bump package version automatically when gptscript is released Signed-off-by: Taylor Price --- .github/workflows/dispatch.yaml | 43 +++++++++++++++++++++++++++++++++ package-lock.json | 4 +-- 2 files changed, 45 insertions(+), 2 deletions(-) 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..7496e60 --- /dev/null +++ b/.github/workflows/dispatch.yaml @@ -0,0 +1,43 @@ +name: Update GPTScript Version +on: + repository_dispatch: + types: release + +jobs: + update-gptscript-dep: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install jq + uses: dcarbone/install-jq-action@v2.1.0 + - name: Update GPTScript Version + run: | + jq '.version = "${{ github.event.client_payload.tag }}"' package.json > temp.json && mv temp.json package.json + sed -i 's/version: "v[0-9.]*"/version: "${{ github.event.client_payload.tag }}"/' scripts/install-binary.js + - uses: actions/setup-node@v4 + with: + node-version: 21 + - name: Update Lock + run: npm i --package-lock-only + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Automated GPTScript Version Update + file_pattern: 'package*.json src/install-binary.js' + tag-release: + needs: update-gptscript-dep + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_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 }} diff --git a/package-lock.json b/package-lock.json index 89edd3b..c86e57d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gptscript-ai/gptscript", - "version": "v0.7.3", + "version": "v0.8.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gptscript-ai/gptscript", - "version": "v0.7.3", + "version": "v0.8.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": {