From 25ecf45f82618e4fe544c287c10594a075d88f63 Mon Sep 17 00:00:00 2001 From: Henrique Santos <118177985+hcsa73@users.noreply.github.com> Date: Fri, 8 Sep 2023 16:03:00 +0100 Subject: [PATCH] Implement release pipeline (#9) * Implement release pipeline * Add main trigger, fix major versions --------- Co-authored-by: Henrique Santos --- .github/workflows/release.yaml | 42 ++++++++++++++++++++++++++++++++ terraform-registry-manifest.json | 8 ++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 terraform-registry-manifest.json diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..fff48af2 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,42 @@ +# Terraform Provider release workflow. +name: Release + +# This GitHub action creates a release when a tag that matches the pattern +# "v*" (e.g. v0.1.0) is created. +on: + push: + tags: + - 'v*' + branches: + - main + +# Releases need permissions to read and write the repository contents. +# GitHub considers creating releases and uploading assets as writing contents. +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + # Allow goreleaser to access older tag information. + fetch-depth: 0 + - uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + cache: true + - name: Import GPG key + uses: crazy-max/ghaction-import-gpg@v5 + id: import_gpg + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + args: release --clean + env: + # GitHub sets the GITHUB_TOKEN secret automatically. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} \ No newline at end of file diff --git a/terraform-registry-manifest.json b/terraform-registry-manifest.json new file mode 100644 index 00000000..047a8e80 --- /dev/null +++ b/terraform-registry-manifest.json @@ -0,0 +1,8 @@ +{ + "version": 1, + "metadata": { + "protocol_versions": [ + "6.0" + ] + } +} \ No newline at end of file