From 36e1c0b67a27f4591c3cf3e4240cda987beb50a5 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Mon, 27 Jun 2022 11:20:15 -0400 Subject: [PATCH] release: move to goreleaser/actions for releases (#113) Prior to this commit, new releases were done through a CircleCI that would invoke a script to tag and release the latest version of the repository on Github. This is now replaced by goreleaser, which will do the same, and trigger the CHANGELOG generation for the next version of the SDK. --- .circleci/config.yml | 38 ----------------------------------- .github/release.yml | 18 +++++++++++++++++ .github/workflows/release.yml | 22 ++++++++++++++++++++ .goreleaser.yml | 8 ++++++++ 4 files changed, 48 insertions(+), 38 deletions(-) create mode 100644 .github/release.yml create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 86ecfc30a..472e149c1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,17 +86,6 @@ jobs: steps: - checkout - run: make generate-check - release-sdk: - executor: golang - environment: - <<: *ENVIRONMENT - steps: - - add_ssh_keys: - fingerprints: - - "52:49:7d:88:9b:81:21:fb:71:86:fd:89:c4:4b:95:df" # circleci-key of packer-ci user in GitHub - - checkout - - run: ./scripts/release/release.sh - workflows: version: 2 @@ -110,30 +99,3 @@ workflows: - check-lint - check-fmt - check-generate - release: - jobs: - - check-generate - - check-fmt - - check-lint - - test-linux - - trigger-release: - filters: - branches: - only: - - main - type: approval - - release-sdk: - context: - - releases-gpg-private-signing-key - - releases-gpg-public-signing-key - filters: - branches: - only: - - main - requires: - - trigger-release - - check-generate - - check-fmt - - check-lint - - test-linux - diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..1f3a89f91 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,18 @@ +changelog: + categories: + - title: Breaking Changes πŸ›  + labels: + - breaking-change + - title: Exciting New Features πŸŽ‰ + labels: + - enhancement + - title: Bug fixesπŸ§‘β€πŸ”§ 🐞 + labels: + - bug + - title: Doc improvements πŸ“š + labels: + - docs + - documentation + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..df3257059 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + +permissions: + # Allow creating GitHub release + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: GoReleaser + uses: goreleaser/goreleaser-action@v3.0.0 + args: "release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..f1585ec9c --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,8 @@ +project_name: packer-plugin-sdk +build: + skip: true +release: + ids: + - 'none' +changelog: + use: github-native