|
| 1 | +# GoReleaser turns one tag push into everything a user might install from: raw |
| 2 | +# archives, Linux packages (deb, rpm, apk), a multi-arch container image, and |
| 3 | +# entries for the package managers (Homebrew, Scoop). `git tag vX.Y.Z && git |
| 4 | +# push --tags` fans out to all of them through .github/workflows/release.yml. |
| 5 | +# |
| 6 | +# Publish steps that push to a repository we do not own yet (the Homebrew tap, |
| 7 | +# the Scoop bucket) self-disable when their token is absent. A release with no |
| 8 | +# extra secrets still produces every downloadable artifact and the container |
| 9 | +# image; each manager lights up the moment its repository and token exist. |
| 10 | +version: 2 |
| 11 | + |
| 12 | +project_name: dbrest |
| 13 | + |
| 14 | +before: |
| 15 | + # Only fetch modules; never `go mod tidy` during a release, the tree is kept |
| 16 | + # tidy in CI. |
| 17 | + hooks: |
| 18 | + - go mod download |
| 19 | + |
| 20 | +builds: |
| 21 | + - id: dbrest |
| 22 | + binary: dbrest |
| 23 | + main: ./cmd/dbrest |
| 24 | + env: |
| 25 | + - CGO_ENABLED=0 |
| 26 | + flags: |
| 27 | + - -trimpath |
| 28 | + ldflags: |
| 29 | + - -s -w |
| 30 | + - -X main.version={{ .Version }} |
| 31 | + - -X main.commit={{ .ShortCommit }} |
| 32 | + - -X main.date={{ .CommitDate }} |
| 33 | + mod_timestamp: "{{ .CommitTimestamp }}" |
| 34 | + targets: |
| 35 | + - linux_amd64 |
| 36 | + - linux_arm64 |
| 37 | + - linux_arm_7 |
| 38 | + - linux_386 |
| 39 | + - darwin_amd64 |
| 40 | + - darwin_arm64 |
| 41 | + - windows_amd64 |
| 42 | + - windows_arm64 |
| 43 | + - freebsd_amd64 |
| 44 | + - freebsd_arm64 |
| 45 | + |
| 46 | +archives: |
| 47 | + # tar.gz everywhere except a zip on Windows. |
| 48 | + - id: default |
| 49 | + name_template: "dbrest_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}" |
| 50 | + format_overrides: |
| 51 | + - goos: windows |
| 52 | + formats: [zip] |
| 53 | + files: |
| 54 | + - LICENSE |
| 55 | + - README.md |
| 56 | + |
| 57 | +nfpms: |
| 58 | + # One nfpm definition emits the deb, rpm, and apk for every Linux build. The |
| 59 | + # package is the binary and its license; the database it serves is whatever |
| 60 | + # the operator points db-uri at, so there are no package dependencies. |
| 61 | + - id: linux-packages |
| 62 | + package_name: dbrest |
| 63 | + file_name_template: "{{ .ConventionalFileName }}" |
| 64 | + vendor: tamnd |
| 65 | + homepage: https://github.com/tamnd/dbrest |
| 66 | + maintainer: Duc-Tam Nguyen <tamnd87@gmail.com> |
| 67 | + description: A PostgREST-compatible REST API for any database. |
| 68 | + license: Apache-2.0 |
| 69 | + formats: |
| 70 | + - deb |
| 71 | + - rpm |
| 72 | + - apk |
| 73 | + bindir: /usr/bin |
| 74 | + section: utils |
| 75 | + contents: |
| 76 | + - src: ./LICENSE |
| 77 | + dst: /usr/share/doc/dbrest/LICENSE |
| 78 | + |
| 79 | +dockers_v2: |
| 80 | + # One multi-platform image built with buildx. GoReleaser stages the prebuilt |
| 81 | + # binaries under per-platform directories in the build context and the |
| 82 | + # Dockerfile copies the right one through $TARGETPLATFORM. |
| 83 | + - images: |
| 84 | + - ghcr.io/tamnd/dbrest |
| 85 | + tags: |
| 86 | + - "{{ .Version }}" |
| 87 | + - latest |
| 88 | + dockerfile: Dockerfile |
| 89 | + platforms: |
| 90 | + - linux/amd64 |
| 91 | + - linux/arm64 |
| 92 | + labels: |
| 93 | + org.opencontainers.image.title: "{{ .ProjectName }}" |
| 94 | + org.opencontainers.image.description: "A PostgREST-compatible REST API for any database" |
| 95 | + org.opencontainers.image.url: "https://github.com/tamnd/dbrest" |
| 96 | + org.opencontainers.image.source: "https://github.com/tamnd/dbrest" |
| 97 | + org.opencontainers.image.version: "{{ .Version }}" |
| 98 | + org.opencontainers.image.revision: "{{ .FullCommit }}" |
| 99 | + org.opencontainers.image.licenses: "Apache-2.0" |
| 100 | + |
| 101 | +homebrew_casks: |
| 102 | + # Homebrew cask pushed to the tap repository. Self-disables until |
| 103 | + # HOMEBREW_TAP_GITHUB_TOKEN (a PAT with write to tamnd/homebrew-tap) is set, |
| 104 | + # so a tokenless release still writes the cask into dist for inspection. |
| 105 | + - name: dbrest |
| 106 | + repository: |
| 107 | + owner: tamnd |
| 108 | + name: homebrew-tap |
| 109 | + token: '{{ envOrDefault "HOMEBREW_TAP_GITHUB_TOKEN" "" }}' |
| 110 | + directory: Casks |
| 111 | + homepage: https://github.com/tamnd/dbrest |
| 112 | + description: A PostgREST-compatible REST API for any database |
| 113 | + skip_upload: '{{ if envOrDefault "HOMEBREW_TAP_GITHUB_TOKEN" "" }}false{{ else }}true{{ end }}' |
| 114 | + commit_author: |
| 115 | + name: Duc-Tam Nguyen |
| 116 | + email: tamnd87@gmail.com |
| 117 | + |
| 118 | +scoops: |
| 119 | + # Scoop manifest for Windows, pushed to the bucket repository. |
| 120 | + - repository: |
| 121 | + owner: tamnd |
| 122 | + name: scoop-bucket |
| 123 | + token: '{{ envOrDefault "SCOOP_BUCKET_GITHUB_TOKEN" "" }}' |
| 124 | + homepage: https://github.com/tamnd/dbrest |
| 125 | + description: A PostgREST-compatible REST API for any database |
| 126 | + license: Apache-2.0 |
| 127 | + skip_upload: '{{ if envOrDefault "SCOOP_BUCKET_GITHUB_TOKEN" "" }}false{{ else }}true{{ end }}' |
| 128 | + commit_author: |
| 129 | + name: Duc-Tam Nguyen |
| 130 | + email: tamnd87@gmail.com |
| 131 | + |
| 132 | +checksum: |
| 133 | + name_template: "checksums.txt" |
| 134 | + algorithm: sha256 |
| 135 | + |
| 136 | +sboms: |
| 137 | + # A CycloneDX SBOM per archive via syft; the release workflow installs it. |
| 138 | + - id: archive |
| 139 | + artifacts: archive |
| 140 | + |
| 141 | +signs: |
| 142 | + # Keyless cosign signature over the checksum file. It runs only on a real |
| 143 | + # release in CI, where the workflow grants the OIDC token cosign needs. |
| 144 | + - cmd: cosign |
| 145 | + certificate: "${artifact}.pem" |
| 146 | + args: |
| 147 | + - sign-blob |
| 148 | + - "--output-certificate=${certificate}" |
| 149 | + - "--output-signature=${signature}" |
| 150 | + - "${artifact}" |
| 151 | + - "--yes" |
| 152 | + artifacts: checksum |
| 153 | + output: true |
| 154 | + |
| 155 | +docker_signs: |
| 156 | + - cmd: cosign |
| 157 | + artifacts: manifests |
| 158 | + args: |
| 159 | + - sign |
| 160 | + - "${artifact}@${digest}" |
| 161 | + - "--yes" |
| 162 | + |
| 163 | +changelog: |
| 164 | + sort: asc |
| 165 | + use: github |
| 166 | + filters: |
| 167 | + exclude: |
| 168 | + - "^docs:" |
| 169 | + - "^test:" |
| 170 | + - "^chore:" |
| 171 | + - "^ci:" |
| 172 | + - Merge pull request |
| 173 | + - Merge branch |
| 174 | + groups: |
| 175 | + - title: Features |
| 176 | + regexp: '^.*?feat(\(.+\))??!?:.+$' |
| 177 | + order: 0 |
| 178 | + - title: Fixes |
| 179 | + regexp: '^.*?fix(\(.+\))??!?:.+$' |
| 180 | + order: 1 |
| 181 | + - title: Other |
| 182 | + order: 999 |
| 183 | + |
| 184 | +release: |
| 185 | + github: |
| 186 | + owner: tamnd |
| 187 | + name: dbrest |
| 188 | + draft: false |
| 189 | + prerelease: auto |
0 commit comments