Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

ci: rollback release pipeline #28

Merged
merged 10 commits into from
May 9, 2024
37 changes: 11 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
Expand All @@ -17,43 +14,31 @@ on:
push:
tags:
- 'v*'
permissions:
contents: write
packages: read
jobs:
get-go-version:
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: 'Determine Go version'
id: get-go-version
run: |
echo "Found Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
goreleaser:
needs:
- get-go-version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
uses: actions/checkout@v2
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
uses: actions/setup-go@v2
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
go-version: 1.21
- name: Describe plugin
id: plugin_describe
run: echo "api_version=$(go run . describe | jq -r '.api_version')" >> "$GITHUB_OUTPUT"
- name: Install signore
uses: hashicorp/setup-signore-package@v1
run: echo "::set-output name=api_version::$(go run . describe | jq -r '.api_version')"
- name: Import GPG key
id: import_gpg
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@f82d6c1c344bcacabba2c841718984797f664a6b # v5.0.0
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --clean --timeout 120m
Expand Down
35 changes: 23 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

# This is an example goreleaser.yaml file with some defaults.
# Make sure to check the documentation at http://goreleaser.com
env:
Expand All @@ -10,10 +7,11 @@ before:
# We strongly recommend running tests to catch any regression before release.
# Even though, this an optional step.
- go test ./...
# As part of the release doc files are included as a separate deliverable for
# consumption by Packer.io. To include a separate docs.zip uncomment the following command.
# - make ci-release-docs
# Check plugin compatibility with required version of the Packer SDK
- make plugin-check
# Copy LICENSE file for inclusion in zip archive
- cp LICENSE LICENSE.txt
builds:
# A separated build to run the packer-plugins-check only once for a linux_amd64 binary
-
Expand Down Expand Up @@ -87,17 +85,30 @@ builds:
archives:
- format: zip
files:
- "LICENSE.txt"

- none*
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
algorithm: sha256
signs:
- cmd: signore
args: ["sign", "--dearmor", "--file", "${artifact}", "--out", "${signature}"]
artifacts: checksum
signature: ${artifact}.sig
- artifacts: checksum
args:
# if you are using this is in a GitHub action or some other automated pipeline, you
# need to pass the batch flag to indicate its not interactive.
- "--batch"
- "--local-user"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--output"
- "${signature}"
- "--detach-sign"
- "${artifact}"
# release:
# If you want to manually examine the release before its live, uncomment this line:
# draft: true
# As part of the release doc files are included as a separate deliverable for consumption by Packer.io.
# To include a separate docs.zip uncomment the extra_files config and the docs.zip command hook above.
# extra_files:
# - glob: ./docs.zip

changelog:
use: github-native
use: github-native
Loading