Skip to content

Commit

Permalink
build: allow easier testing of a release
Browse files Browse the repository at this point in the history
The CI variable is not present locally; this is used to disable changelog and release by default when running GoReleaser locally.
  • Loading branch information
jamestelfer committed Sep 21, 2024
1 parent 734450e commit b155d86
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KO_DOCKER_REPO: "chinmina" # the DockerHub chinmina repository
19 changes: 11 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
version: 2

env:
- 'CI={{ (envOrDefault "CI" "false") }}'
- 'CHANGELOG_DISABLE={{ eq (envOrDefault "CI" "false") "false" }}'
- 'RELEASE_DISABLE={{ eq (envOrDefault "CI" "false") "false" }}'
- 'KO_DOCKER_REPO={{ envOrDefault "KO_DOCKER_REPO" (printf "ttl.sh/chinmina-prerelease/%d" .Now.Unix) }}'

builds:
- id: release
binary: chinmina-bridge
Expand All @@ -21,10 +27,13 @@ archives:
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"

changelog:
disable: "{{ .Env.CHANGELOG_DISABLE }}"
use: github-native
sort: asc

release:
disable: "{{ .Env.RELEASE_DISABLE }}"

prerelease: auto
header: |
Distributions for this release are published as binaries and a Docker image.
Expand All @@ -46,20 +55,14 @@ kos:
working_dir: .
base_image: cgr.dev/chainguard/static

repository: chinmina
# repository is set using environment variables in the top-level env section
# (see above).

# Platforms to build and publish.
#
# Default: 'linux/amd64'
platforms:
- linux/amd64
- linux/arm64

# Tag to build and push.
# Empty tags are ignored.
#
# Default: 'latest'
# Templates: allowed
tags:
- "{{if not .Prerelease}}latest{{end}}"
- "{{.Tag}}"
Expand Down

0 comments on commit b155d86

Please sign in to comment.