diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index 8e0d7410..00000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,19 +0,0 @@ -name-template: 'v$NEXT_PATCH_VERSION 🌈' -tag-template: 'v$NEXT_PATCH_VERSION' -categories: - - title: '🚀 Features' - labels: - - 'feature' - - 'enhancement' - - title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - title: '🧰 Maintenance' - label: 'chore' -change-template: '- $TITLE @$AUTHOR (#$NUMBER)' -template: | - ## Changes - - $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 666d4f9b..d69aad0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16 # please change also in `release.yml` and `go.mod` + go-version: ${{ secrets.GO_VERSION }} - name: Checkout code uses: actions/checkout@v2 - name: Go fmt diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml deleted file mode 100644 index 25fc31a8..00000000 --- a/.github/workflows/release-drafter.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Release Drafter - -on: - push: - branches: - - main - -jobs: - release: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: toolmantim/release-drafter@v5.15.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a2c932e..651d7885 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ name: release on: push: tags: - - 'v*' + - 'v*.*.*' jobs: goreleaser: runs-on: ubuntu-latest @@ -28,15 +28,12 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 # please change also in `ci.yml` and `go.mod` + go-version: ${{ secrets.GO_VERSION }} - name: Import GPG key + uses: hashicorp/ghaction-import-gpg@v2.1.0 id: import_gpg - # TODO: move this to HashiCorp namespace or find alternative that is just simple gpg commands - # see https://github.com/hashicorp/terraform-provider-scaffolding/issues/22 - uses: paultyng/ghaction-import-gpg@v2.1.0 env: - # These secrets will need to be configured for the repository: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} - @@ -47,5 +44,4 @@ jobs: args: release --rm-dist env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - # GitHub sets this automatically GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update-generated-docs.yml b/.github/workflows/update-generated-docs.yml new file mode 100644 index 00000000..24827aa0 --- /dev/null +++ b/.github/workflows/update-generated-docs.yml @@ -0,0 +1,32 @@ +name: Update generated docs + +on: + push: + +jobs: + Update-generated-docs: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + + - name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ secrets.GO_VERSION }} + - + name: Update generated docs + run: ./generate-docs.sh + - + name: Commit changes + uses: EndBug/add-and-commit@v8 + with: + author_name: update generated docs action + author_email: mail@example.com + message: 'Update docs' + add: 'docs/*' + diff --git a/README.md b/README.md index 8f553520..418bf54f 100644 --- a/README.md +++ b/README.md @@ -150,9 +150,6 @@ go generate ./... ## Release To release a version to the [Terraform Public Registry](https://registry.terraform.io/providers/env0/env0/latest?pollNotifications=true) - -1. Docs must be generated manually and committed to the repo before release. (`./generate-docs.sh`) -2. Create and push a tag locally, in semver format - `git tag v0.0.9 && git push origin --tags` -3. Goto [Github Releases](https://github.com/env0/terraform-provider-env0/releases) and edit the draft created by Release Drafter Bot - it should contain the change log for the release. Make sure it's pointing at the tag you created in the previous step and publish the release. -4. Binaries will be automatically generated by the Github action defined in `.github/workflows/release.yml` -5. The Registry will automatically pick up on the new version. If the registry says the release doesn't have any binaries, check the result of the `release` Github action. You might need to [Resync](https://registry.terraform.io/providers/env0/env0/latest/settings?pollNotifications=true) the registry after the action finishes. - +1. Create and push a tag **locally**, in semver format - `git tag v0.0.9 && git push origin --tags` +2. New release with binaries **will be automatically generated** by the GitHub action defined in `.github/workflows/release.yml`. +3. The Registry will automatically pick up on the new version. diff --git a/docs/data-sources/template.md b/docs/data-sources/template.md index bf05a694..a6def21f 100644 --- a/docs/data-sources/template.md +++ b/docs/data-sources/template.md @@ -26,6 +26,7 @@ data "env0_template" "example" { - **github_installation_id** (Number) The env0 application installation id on the relevant github repository - **gitlab_project_id** (Number) The project id of the relevant repository - **id** (String) id of the template +- **is_gitlab_enterprise** (Boolean) Does this template use gitlab enterprise repository? - **name** (String) the name of the template - **token_id** (String) The token id used for private git repos or for integration with GitLab diff --git a/docs/index.md b/docs/index.md index ae370c81..48afe4ed 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,8 +22,11 @@ provider "env0" { ## Schema -### Optional +### Required -- **api_endpoint** (String) override api endpoint (used for testing) - **api_key** (String, Sensitive) env0 api key (https://developer.env0.com/docs/api/YXBpOjY4Njc2-env0-api#creating-an-api-key) - **api_secret** (String, Sensitive) env0 api key secret + +### Optional + +- **api_endpoint** (String) override api endpoint (used for testing) diff --git a/go.mod b/go.mod index 4e57baa3..61891548 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/env0/terraform-provider-env0 -go 1.16 // please change also in `ci.yml` and `release.yml` +go 1.16 // please change also in repo secrets require ( github.com/adhocore/gronx v0.2.6