Skip to content

Commit

Permalink
build: Upgrade to GoReleaser Pro. (#467)
Browse files Browse the repository at this point in the history
This commit updates our build to use GoReleaser Pro. Building tighter
integration with GoReleaser should allow us to release to more
platforms. In future changes, I hope to use GoReleaser to take over a
lot of the build steps that are currently in Make and shell scripts.
  • Loading branch information
betterengineering authored Oct 31, 2022
1 parent fec8f42 commit 06e991f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 38 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,16 @@ jobs:
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: build

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
version: v1.7.0
distribution: goreleaser-pro
version: v1.12.3
args: release
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.TIDBYT_GITHUB_TOKEN }}
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
33 changes: 16 additions & 17 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
dist: out

builds:
- dir: .goreleaser

goarch:
- amd64
- arm64

goos:
- darwin
- linux
- windows
before:
hooks:
- scripts/set-executable.sh

ignore:
- goos: windows
goarch: arm64

hooks:
post: ./.goreleaser/fetch-artifacts.sh
builds:
- builder: prebuilt
binary: pixlet

targets:
- darwin_amd64
- darwin_arm64
- linux_amd64
- linux_arm64
- windows_amd64

prebuilt:
path: build/{{ .Os }}_{{ .Arch }}/pixlet{{ .Ext }}

checksum:
name_template: "checksums.txt"
Expand Down
7 changes: 0 additions & 7 deletions .goreleaser/dummy.go

This file was deleted.

13 changes: 0 additions & 13 deletions .goreleaser/fetch-artifacts.sh

This file was deleted.

7 changes: 7 additions & 0 deletions scripts/set-executable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

set -euo pipefail

for dist in "darwin_amd64" "linux_amd64" "darwin_arm64" "linux_arm64"; do
chmod +x "build/$dist/pixlet"
done

0 comments on commit 06e991f

Please sign in to comment.