From 8acb4996efd12e541ccc6fd8652b44bc777c2e94 Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 11:31:38 -0300 Subject: [PATCH 1/6] ci: rollback release pipeline --- .github/workflows/release.yml | 39 +++++++++++------------------------ 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27ea21934..5823ed699 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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). # @@ -17,46 +14,34 @@ 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.17 - 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/ghaction-import-gpg@v5.0.0 + 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 + args: release --rm-dist env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d6b8797f84705a73f3f4d0a32ad02cfff56af4ed Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 11:31:38 -0300 Subject: [PATCH 2/6] ci: rollback release pipeline --- .github/workflows/release.yml | 39 +++++++++++------------------------ .goreleaser.yml | 35 ++++++++++++++++++++----------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27ea21934..5823ed699 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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). # @@ -17,46 +14,34 @@ 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.17 - 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/ghaction-import-gpg@v5.0.0 + 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 + args: release --rm-dist env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 4e2db89a5..de97bc2f0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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: @@ -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 - @@ -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 \ No newline at end of file From 98fc1f6d93941667c44809d5ab36e7919a01accb Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 12:03:57 -0300 Subject: [PATCH 3/6] ci: remove deprecated argument --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5823ed699..2bb526b6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --rm-dist + args: release --clean --timeout 120m env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c4d470a8ba52118892baffdd0f94f1b40f3faea3 Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 12:06:00 -0300 Subject: [PATCH 4/6] ci: upgrade go version --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2bb526b6e..48d472479 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.21 - name: Describe plugin id: plugin_describe run: echo "::set-output name=api_version::$(go run . describe | jq -r '.api_version')" From e522d9363cdfd15a62e2da17aef16e8bdd2e641a Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 12:12:13 -0300 Subject: [PATCH 5/6] ci: remove doc generation if one wants to access the doc looks at the upstream docs --- .goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index de97bc2f0..a85b5a31d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,7 +9,7 @@ before: - 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 + # - make ci-release-docs # Check plugin compatibility with required version of the Packer SDK - make plugin-check builds: From 8301848434a4f56ca39ae0b108dab2195e99875a Mon Sep 17 00:00:00 2001 From: "Rodrigo C. Moraes" Date: Thu, 9 May 2024 12:12:13 -0300 Subject: [PATCH 6/6] ci: remove doc generation if one wants to access the doc looks at the upstream docs --- .goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index de97bc2f0..a85b5a31d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,7 +9,7 @@ before: - 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 + # - make ci-release-docs # Check plugin compatibility with required version of the Packer SDK - make plugin-check builds: