From f474a6d438f3b35e63cb4a74adb8e5fc0ec0c36a Mon Sep 17 00:00:00 2001 From: Rob Holland Date: Mon, 24 Jun 2024 12:46:00 +0100 Subject: [PATCH] Release binaries. This is for deployment outside of Docker. --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .goreleaser.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..5fa89f7eb4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Build Release + +on: + release: + types: + - released + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + check-latest: true + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: '~> v2' + args: release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000000..12229230ff --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,31 @@ +before: + hooks: + - go mod download + +release: + name_template: "v{{ .Version }}" + mode: keep-existing # This ensures existing releases are kept and updated + +builds: + - main: ./cmd/server + binary: ui-server + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + +archives: + - format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - README.md + - LICENSE + +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" + algorithm: sha256