-
Notifications
You must be signed in to change notification settings - Fork 156
117 lines (100 loc) · 4.64 KB
/
create-release-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- 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@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- 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@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@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- 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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: "20.x"
- name: Install cdktf-registry-docs
run: npm install -g [email protected]
- name: Download artifacts
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
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@9153d834b60caba6d51c9b9510b087acf9f33f83 # v6.0.4
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.