name: release on: workflow_dispatch: inputs: tag: description: "Release tag to create (e.g. v1.2.3)" required: true type: string permissions: contents: write jobs: windows: runs-on: windows-latest steps: - uses: actions/checkout@v6 - uses: actions/setup-go@v6 with: go-version-file: go.mod - name: Build run: | New-Item -ItemType Directory -Force dist | Out-Null go build -o dist/bootstrap_windows_env.exe ./cmd/bootstrap_windows_env Get-FileHash dist/bootstrap_windows_env.exe -Algorithm SHA256 | ForEach-Object { "$($_.Hash.ToLower()) bootstrap_windows_env.exe" } | Set-Content dist/bootstrap_windows_env.exe.sha256 - name: Publish env: GH_TOKEN: ${{ github.token }} run: | $tag = "${{ inputs.tag }}" gh release view $tag 2>$null if ($LASTEXITCODE -ne 0) { gh release create $tag --title $tag --target ${{ github.sha }} --notes "Windows bootstrapper $tag" } gh release upload $tag dist/bootstrap_windows_env.exe dist/bootstrap_windows_env.exe.sha256 --clobber