github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/.goreleaser.yaml (about)

     1  before:
     2    hooks:
     3      - go mod tidy
     4  
     5  # Build a universal macOS binary
     6  universal_binaries:
     7    - replace: false
     8  
     9  # Build the different combination of goos/arch binaries
    10  builds:
    11    - env:
    12        - CGO_ENABLED=0
    13      goos:
    14        - linux
    15        - darwin
    16        - windows
    17      ldflags:
    18        - -s -w -X github.com/Racer159/jackal/src/config.CLIVersion={{.Tag}}
    19        - -X k8s.io/component-base/version.gitVersion=v{{.Env.K8S_MODULES_MAJOR_VER}}.{{.Env.K8S_MODULES_MINOR_VER}}.{{.Env.K8S_MODULES_PATCH_VER}}
    20        - -X k8s.io/component-base/version.gitCommit={{.FullCommit}}
    21        - -X k8s.io/component-base/version.buildDate={{.Date}}
    22        - -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMajor={{.Env.K8S_MODULES_MAJOR_VER}}
    23        - -X helm.sh/helm/v3/pkg/lint/rules.k8sVersionMinor={{.Env.K8S_MODULES_MINOR_VER}}
    24        - -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMajor={{.Env.K8S_MODULES_MAJOR_VER}}
    25        - -X helm.sh/helm/v3/pkg/chartutil.k8sVersionMinor={{.Env.K8S_MODULES_MINOR_VER}}
    26        - -X github.com/derailed/k9s/cmd.version={{.Env.K9S_VERSION}}
    27        - -X github.com/google/go-containerregistry/cmd/crane/cmd.Version={{.Env.CRANE_VERSION}}
    28        - -X github.com/Racer159/jackal/src/cmd/tools.syftVersion={{.Env.SYFT_VERSION}}
    29        - -X github.com/Racer159/jackal/src/cmd/tools.archiverVersion={{.Env.ARCHIVER_VERSION}}
    30        - -X github.com/Racer159/jackal/src/cmd/tools.helmVersion={{.Env.HELM_VERSION}}
    31      goarch:
    32        - amd64
    33        - arm64
    34  
    35  # Save the built artifacts as binaries (instead of wrapping them in a tarball)
    36  archives:
    37    - format: binary
    38      name_template: "{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}"
    39  
    40  # generate a sha256 checksum of all release artifacts
    41  # NOTE: We are explicitly adding the init-packages that are built prior to GoReleaser stage in the GitHub Actions workflow
    42  checksum:
    43    name_template: "checksums.txt"
    44    extra_files:
    45      - glob: ./build/jackal-init-*
    46    algorithm: sha256
    47  
    48  # generate sboms for each binary artifact
    49  sboms:
    50    - artifacts: binary
    51      documents:
    52        - "sbom_{{ .ProjectName }}_{{ .Tag }}_{{- title .Os }}_{{ .Arch }}.sbom"
    53  
    54  snapshot:
    55    name_template: "{{ incpatch .Version }}-snapshot"
    56  
    57  # Use the auto-generated changelog github provides
    58  changelog:
    59    use: github-native
    60  
    61  # Generate a GitHub release and publish the release for the tag
    62  # NOTE: We are explicitly adding the init-packages that are built prior to GoReleaser stage in the GitHub Actions workflow
    63  release:
    64    github:
    65      owner: defenseunicorns
    66      name: jackal
    67    prerelease: auto
    68    mode: append
    69    extra_files:
    70      - glob: ./build/jackal-init-*
    71  
    72  # Update the 'generic' brew formula and create a versioned brew formula for artifacts from this release
    73  brews:
    74    - name: "{{ .Env.BREW_NAME }}"
    75      tap:
    76        owner: defenseunicorns
    77        name: homebrew-tap
    78        token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    79        branch: "{{ .ProjectName }}-{{ .Tag }}"
    80        pull_request:
    81          enabled: true
    82          base:
    83            branch: main
    84            owner: defenseunicorns
    85            name: homebrew-tap
    86  
    87      commit_msg_template: "build(release): upgrade {{ .ProjectName }} to {{ .Tag }}"
    88      homepage: "https://jackal.dev/"
    89      description: "DevSecOps for Air Gap"
    90  
    91    # NOTE: We are using .Version instead of .Tag because homebrew has weird semver parsing rules and won't be able to
    92    #       install versioned releases that has a `v` character before the version number.
    93    - name: "jackal@{{ .Version }}"
    94      tap:
    95        owner: defenseunicorns
    96        name: homebrew-tap
    97        token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
    98        branch: "{{ .ProjectName }}-{{ .Tag }}"
    99        pull_request:
   100          enabled: true
   101          base:
   102            branch: main
   103            owner: defenseunicorns
   104            name: homebrew-tap
   105      commit_msg_template: "build(release): {{ .ProjectName }}@{{ .Tag }}"
   106      homepage: "https://jackal.dev/"
   107      description: "DevSecOps for Air Gap"
   108  
   109  # Upload artifact backups to s3
   110  blobs:
   111    - provider: s3
   112      region: us-gov-west-1
   113      bucket: jackal-public
   114      folder: "release/{{.Version}}"