diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000000000000000000000000000000000..33096d758fa676ae1112aa6d7d26a4760cd67656 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +# 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 }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000000000000000000000000000000000000..ffc48f2980af821fd2ceadb3391affe877337e6d --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,43 @@ +# 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