Skip to content

Commit 4673c7f

Browse files
committed
split goreleaser template in multiple files
To get rid of the `sed` magic in our release workflow and improve readability of the individual files. Also this allows you to run goreleaser locally without any additional steps. Signed-off-by: Jan Martens <jan@martens.eu.org>
1 parent bccd4d9 commit 4673c7f

File tree

5 files changed

+1178
-1075
lines changed

5 files changed

+1178
-1075
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ jobs:
4242
release_os:
4343
- linux
4444
- hsm
45-
- darwin
46-
- freebsd
47-
- illumos
48-
- netbsd
49-
- openbsd
50-
- windows
45+
- other
5146
steps:
5247
- name: Disable release on nightly repository
5348
if: ${{ !inputs.nightly }}
@@ -184,24 +179,13 @@ jobs:
184179
run: |
185180
make static-dist
186181
187-
# Execute Go binary builds
188-
- name: "Template GoRelaser configuration"
189-
if: startsWith(github.ref, 'refs/tags/') || inputs.nightly
190-
run: |
191-
[ "${{ matrix.release_os }}" != "hsm" ] && sed "s/REPLACE_WITH_RELEASE_GOOS/${{ matrix.release_os }}/g" .goreleaser-template.yaml > .goreleaser.yaml
192-
[ "${{ matrix.release_os }}" == "hsm" ] && sed "s/REPLACE_WITH_RELEASE_GOOS/linux/g" .goreleaser-template.yaml > .goreleaser.yaml
193-
[ "${{ matrix.release_os }}" == "linux" ] && sed -i "s/^#LINUXONLY#//g" .goreleaser.yaml || true
194-
[ "${{ matrix.release_os }}" == "hsm" ] && sed -i "s/^#HSMONLY#//g" .goreleaser.yaml || true
195-
[ "${{ matrix.release_os }}" != "hsm" ] && sed -i "s/^#NONHSM#//g" .goreleaser.yaml || true
196-
sed -i "s/^#OTHERARCH#//g" .goreleaser.yaml
197-
198182
- name: "GoReleaser: Release"
199183
if: startsWith(github.ref, 'refs/tags/') || inputs.nightly
200184
uses: goreleaser/goreleaser-action@v6
201185
with:
202186
distribution: goreleaser
203187
version: latest
204-
args: release --clean --timeout=60m --verbose --parallelism 2
188+
args: release --clean --timeout=60m --verbose --parallelism 2 -f goreleaser.${{ matrix.release_os }}.yaml
205189
env:
206190
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
207191
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}

0 commit comments

Comments
 (0)