Repository navigation
69 lines (60 loc) · 2.06 KB
/
Copy pathrelease.yml
File metadata and controls
69 lines (60 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Release pgman-proxy and pgmctl binaries via GoReleaser.
#
# Triggers:
# - push tag matching v* — release builds (creates draft GitHub release)
# - workflow_dispatch — manual snapshot builds (no release, just artifacts)
#
# Produces:
# - pgman-proxy static binaries (linux/amd64, linux/arm64)
# - pgmctl static binaries (linux+darwin / amd64+arm64)
# - tar.gz archives + checksums
# - Multi-arch distroless OCI image on GHCR (pgman-proxy only), tagged
# :X.Y.Z-distroless and :distroless. The plain tags belong to the bundled
# image from release-image.yml.
name: release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
goreleaser:
runs-on: ubuntu-latest
env:
GOPRIVATE: github.com/f1bonacc1/*
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# pgman-proxy/go.mod pins the private module
# github.com/f1bonacc1/pg-manager. Authenticate the Go toolchain so
# GoReleaser's `go mod download` can fetch it. PG_MANAGER_TOKEN is a
# repo secret with contents:read on f1bonacc1/pg-manager. No go.mod
# patching is needed any more, so GoReleaser sees a clean tree.
- name: Authenticate private module fetch
run: |
git config --global \
url."https://x-access-token:${{ secrets.PG_MANAGER_TOKEN }}@github.com/".insteadOf \
"https://github.com/"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: >-
release
${{ github.event_name == 'workflow_dispatch' && '--snapshot' || '' }}
--clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}