From c6fef469163411c55bd32867d94f329ad0d8481d Mon Sep 17 00:00:00 2001 From: Hayden Barnes Date: Tue, 20 Feb 2024 15:59:48 -0500 Subject: [PATCH] Add WinGet install steps and automation --- .github/workflows/release.yaml | 15 +++++++++++++++ README.md | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bb4258cb..532cdb2b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -31,3 +31,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_PROJECT_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }} GORELEASER_CURRENT_TAG: ${{ github.ref_name }} + winget-release: + needs: release-tag + runs-on: windows-latest + steps: + - name: Install winget-create + run: | + Invoke-WebRequest -Uri 'https://aka.ms/wingetcreate/latest' -OutFile 'wingetcreate.exe' + - name: Create WinGet Package Update Pull Request + run: | + $latestRelease = Invoke-RestMethod -Uri https://api.github.com/repos/gptscript-ai/gptscript/releases/latest + $url = $latestRelease.assets | Where-Object { $_.name -eq ("gptscript-" + $latestRelease.tag_name + "-windows-amd64.zip") } | Select-Object -ExpandProperty browser_download_url + ./wingetcreate.exe update --submit --token "${{ secrets.GITHUB_TOKEN }}" --urls $url --version "${{ github.event.release.tag_name }}" gptscript-ai.gptscript + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/README.md b/README.md index 10fcf0f1..d5b3746b 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,12 @@ brew install gptscript-ai/tap/gptscript curl https://get.gptscript.ai/install.sh | sh ``` +#### WinGet (Windows) + +```shell +winget install gptscript-ai.gptscript +``` + #### Manually Download and install the archive for your platform and architecture from the [releases page](https://github.com/gptscript-ai/gptscript/releases).