Merge pull request #71 from tylerslaton/fix-issue-with-download #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- "v*" | |
permissions: | |
contents: write | |
jobs: | |
release-tag: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
cache: false | |
go-version: "1.22" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: v1.23.0 | |
args: release --clean | |
env: | |
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 }} | |