Skip to content

Commit dd512fb

Browse files
committed
Finalize release workflow: Use GoReleaser v2, add Chocolatey ids, ensure all packages build on Ubuntu
1 parent 20f5cff commit dd512fb

File tree

2 files changed

+9
-46
lines changed

2 files changed

+9
-46
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -29,60 +29,19 @@ jobs:
2929
- name: Validate GoReleaser config
3030
uses: goreleaser/goreleaser-action@v6
3131
with:
32-
version: latest
32+
version: '~> v2'
3333
args: check
3434

3535
- name: Run GoReleaser
3636
uses: goreleaser/goreleaser-action@v6
3737
with:
38-
version: latest
39-
args: release --clean --skip=chocolatey
38+
distribution: goreleaser
39+
version: '~> v2'
40+
args: release --clean
4041
env:
4142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4243
# Custom tokens for package manager repositories
4344
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
4445
SCOOP_BUCKET_TOKEN: ${{ secrets.SCOOP_BUCKET_TOKEN }}
45-
WINGET_PR_TOKEN: ${{ secrets.WINGET_PR_TOKEN }}
46-
47-
chocolatey:
48-
name: Build Chocolatey Package
49-
runs-on: windows-latest
50-
needs: release
51-
permissions:
52-
contents: write
53-
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@v4
57-
with:
58-
fetch-depth: 0
59-
60-
- name: Set up Go
61-
uses: actions/setup-go@v5
62-
with:
63-
go-version: "1.24.4"
64-
65-
- name: Install Chocolatey
66-
shell: pwsh
67-
run: |
68-
Set-ExecutionPolicy Bypass -Scope Process -Force
69-
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
70-
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
71-
72-
- name: Verify Chocolatey installation
73-
shell: pwsh
74-
run: |
75-
# Refresh environment to pick up Chocolatey PATH
76-
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
77-
choco --version
78-
79-
- name: Run GoReleaser (Chocolatey only)
80-
uses: goreleaser/goreleaser-action@v6
81-
with:
82-
version: latest
83-
args: release --clean --skip=homebrew,scoop,winget,nfpm
84-
env:
85-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8646
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
87-
# Ensure Chocolatey is in PATH for GoReleaser
88-
Path: ${{ env.Path }};C:\ProgramData\chocolatey\bin
47+
WINGET_PR_TOKEN: ${{ secrets.WINGET_PR_TOKEN }}

.goreleaser.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ scoops:
132132
license: "MIT"
133133

134134
# Chocolatey (Windows)
135+
# GoReleaser can build Chocolatey packages on Ubuntu - it generates .nupkg files internally
136+
# and pushes them via HTTP using the API key. No choco CLI needed.
135137
chocolateys:
136138
- name: fontget
139+
ids:
140+
- default
137141
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
138142
title: "FontGet"
139143
owners: "Graphixa"

0 commit comments

Comments
 (0)