Skip to content

Commit

Permalink
Chore make the release process simply (#228)
Browse files Browse the repository at this point in the history
* Chore - make the release process simply
  • Loading branch information
GiliFaroEnv0 committed Feb 27, 2022
1 parent 9f3612b commit 1aa9e32
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 51 deletions.
19 changes: 0 additions & 19 deletions .github/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/release-drafter.yml

This file was deleted.

10 changes: 3 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: release
on:
push:
tags:
- 'v*'
- 'v*.*.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -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/[email protected]
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/[email protected]
env:
# These secrets will need to be configured for the repository:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
-
Expand All @@ -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 }}
32 changes: 32 additions & 0 deletions .github/workflows/update-generated-docs.yml
Original file line number Diff line number Diff line change
@@ -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: [email protected]
message: 'Update docs'
add: 'docs/*'

9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
1 change: 1 addition & 0 deletions docs/data-sources/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ provider "env0" {
<!-- schema generated by tfplugindocs -->
## 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)
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1aa9e32

Please sign in to comment.