Skip to content
Snippets Groups Projects
Commit dc92db5e authored by kayrus's avatar kayrus
Browse files

Introduce goreleaser

parent d4143475
Branches
Tags v0.5.7
No related merge requests found
# This GitHub action will publish assets for release when a tag is created
# that matches the pattern "v*" (ie. v0.1.0).
#
# Based on the configuration provided at:
# https://github.com/hashicorp/terraform-provider-scaffolding
name: Release
on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: v2
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
version: 2
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
- go mod tidy
builds:
- env:
# goreleaser does not work with CGO, it could also complicate
# usage by users in CI/CD systems like Terraform Cloud where
# they are unable to install libraries.
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.Version={{.Version}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}-{{ .Version }}-SHA256SUMS'
algorithm: sha256
release:
# Visit your project's GitHub Releases page to publish this release.
draft: true
changelog:
disable: true
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment