feat: enhance dev workflow and prepare for goreleaser

- Update Makefile with new targets:
  - lint-backend: Run golangci-lint via Docker
  - lint-docker: Run hadolint via Docker
  - test-race: Run Go tests with race detection
  - benchmark: Run Go benchmarks
  - integration-test: Run local integration tests
- Update .pre-commit-config.yaml:
  - Add go-test-race hook
  - Add golangci-lint hook
  - Add hadolint hook
- Add .goreleaser.yaml configuration:
  - Define builds for linux/amd64 and linux/arm64
  - Configure archive creation (tar.gz)
  - Configure package creation (deb, rpm)
- Add .github/workflows/release-goreleaser.yml:
  - New workflow to test GoReleaser builds
  - Builds frontend first, then uses GoReleaser
  - Handles cross-compilation dependencies
This commit is contained in:
Wikid82
2025-11-28 00:28:42 +00:00
parent fc27b5c42e
commit ca4ddc4e3e
4 changed files with 161 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
name: Release (GoReleaser)
on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: write
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: '1.25.4'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24.11.1'
- name: Build Frontend
working-directory: frontend
run: |
npm ci
npm run build
- name: Install Cross-Compilation Tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.CPMP_TOKEN }}
# Cross-compile env vars
CC_linux_amd64: gcc
CXX_linux_amd64: g++
CC_linux_arm64: aarch64-linux-gnu-gcc
CXX_linux_arm64: aarch64-linux-gnu-g++
CGO_ENABLED: 1