Create Release PR #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release PR | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
type: string | |
description: "The version to release, e.g. v1.2.3" | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
releasedVersion: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.remove-leading-v.outputs.version }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1.6.0 | |
id: get-latest-tag | |
with: | |
semver_only: true | |
- name: Remove leading v from tag | |
id: remove-leading-v | |
run: | | |
VERSION='${{ steps.get-latest-tag.outputs.tag }}' | |
echo "VERSION=${VERSION:1}" >> $GITHUB_OUTPUT | |
buildBinary: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Set up Go | |
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Sync dependencies | |
shell: bash | |
run: | | |
go mod download | |
go mod tidy | |
- name: Build | |
run: | | |
go build -o terraform-provider-tfe | |
- name: Upload test artifacts | |
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
with: | |
name: terraform-provider-tfe | |
path: terraform-provider-tfe | |
retention-days: 1 | |
prepare-release-pr: | |
needs: | |
- releasedVersion | |
- buildBinary | |
runs-on: ubuntu-latest | |
container: | |
image: docker.mirror.hashicorp.services/hashicorp/jsii-terraform | |
env: | |
CHECKPOINT_DISABLE: "1" | |
timeout-minutes: 120 | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Brandon Croft" | |
- name: Get yarn cache directory path | |
id: global-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
id: global-cache | |
with: | |
path: ${{ steps.global-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-integration-yarn-${{ hashFiles('**/yarn.lock') }} | |
- name: Setup Node.js | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | |
with: | |
node-version: "20.x" | |
- name: Install cdktf-registry-docs | |
run: npm install -g [email protected] | |
- name: Download artifacts | |
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
with: | |
name: terraform-provider-tfe | |
- name: Run conversion | |
run: | | |
chmod +x terraform-provider-tfe | |
cdktf-registry-docs convert --language='typescript,python' --parallel-conversions-per-document=2 --provider-from-binary="$(pwd)/terraform-provider-tfe" --binary-version='${{ needs.releasedVersion.outputs.version }}' . | |
env: | |
TF_PLUGIN_CACHE_DIR: ${{ steps.global-cache-dir-path.outputs.dir }}/terraform-plugins | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 | |
with: | |
commit-message: "cdktf: update documentation" | |
title: "release: ${{ github.event.inputs.version }}" | |
body: | | |
# Release Preparation PR/Checklist | |
This PR is meant to automate certain preparations for release and instruct maintainers on the manual release tasks. Push any changes you make to this branch and merge it just before creating a release. | |
1. Ensure both main and nightly CI actions passed. These test the release version against HCP Terraform and Terraform Enterprise, respectively. | |
2. Review the CHANGELOG and ensure and ensure [everything that's changed since the last release](https://github.com/hashicorp/terraform-provider-tfe/compare/v${{ needs.releasedVersion.outputs.version }}...main) is described. If anything is missing, inaccurate, or unclear, now is the time to fix it! Check the CHANGELOG organization: pull breaking changes to the top and make sure the most important features are at the top of the FEATURES list. Check the version header in the changelog. It must be: `## v${{ github.event.inputs.version }}` | |
3. Bump the static versions given as an example in the `website/docs/index.html.markdown` docs | |
4. Bump the static versions given in the README installation section. |