From 5216afd4649e17bf0293c968f19ede4abf274ed4 Mon Sep 17 00:00:00 2001 From: Clancy Date: Wed, 5 Aug 2026 16:19:56 +0300 Subject: [PATCH] feat(release): add release workflow and GoReleaser configuration --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++ .goreleaser.yaml | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3a5e352 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: + - 'v*.*.*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to release (e.g. v0.1.0)' + required: false + +permissions: + contents: write + +jobs: + goreleaser: + name: Build & Release Binaries + 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' + cache: true + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: ~> v2 + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..2776e6a --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,50 @@ +version: 2 +project_name: phi + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm64 + binary: phi + main: ./main.go + +archives: + - format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip + +nfpms: + - id: phi-packages + package_name: phi + file_name_template: "{{ .PackageName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + vendor: VoidClancy + homepage: https://phi-orm.vercel.app + maintainer: Clancy + description: "Phi - A compile-time ORM for Go mirroring the Prisma developer experience." + license: MIT + formats: + - deb + - rpm + bindir: /usr/local/bin + +checksum: + name_template: "checksums.txt" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"