From 76b12b0cde91c79d891fd1597fdaba83f2ab0dad Mon Sep 17 00:00:00 2001 From: Leynos Date: Mon, 1 Sep 2025 02:59:01 +0100 Subject: [PATCH] Add GoReleaser packaging for release builds Packages cross-built binaries into archives and Linux deb/rpm packages while retaining standalone binaries. --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 30 +++++++++++++++++++++++++ 2 files changed, 72 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 00000000..0848543f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + release: + types: [published] + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v5 + - name: Setup Rust + uses: leynos/shared-actions/.github/actions/setup-rust@c6559452842af6a83b83429129dccaf910e34562 + - name: Install cross + run: cargo install cross + - name: Build binaries + run: | + cross build --target x86_64-unknown-linux-gnu --release + cross build --target x86_64-apple-darwin --release + cross build --target x86_64-unknown-freebsd --release + - name: Prepare dist + run: | + mkdir -p dist/wireframe_linux_amd64 + cp target/x86_64-unknown-linux-gnu/release/wireframe dist/wireframe_linux_amd64/ + mkdir -p dist/wireframe_darwin_amd64 + cp target/x86_64-apple-darwin/release/wireframe dist/wireframe_darwin_amd64/ + mkdir -p dist/wireframe_freebsd_amd64 + cp target/x86_64-unknown-freebsd/release/wireframe dist/wireframe_freebsd_amd64/ + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: v1.24.0 + args: release --clean --skip=build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..8e78bb71 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,30 @@ +project_name: wireframe +builds: + - id: wireframe + binary: wireframe + goos: + - linux + - darwin + - freebsd + goarch: + - amd64 + skip: true +archives: + - id: wireframe-archive + builds: [wireframe] + format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE + - README.md +nfpms: + - id: wireframe-nfpm + builds: [wireframe] + file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + formats: [deb, rpm] + maintainer: "Payton McIntosh " + description: "An experimental Rust library that simplifies building servers and clients for custom binary protocols." + license: ISC + homepage: https://github.com/leynos/wireframe +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"