Skip to content

Create Release PR

Create Release PR #15

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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- 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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
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@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
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@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- run: git config --global user.email "bcroft@hashicorp.com"
- 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "18.x"
- name: Install cdktf-registry-docs
run: npm install -g cdktf-registry-docs@1.10.1
- name: Download artifacts
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
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@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.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 TFC and TFE, 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.