forked from tencentcloudstack/pulumi-tencentcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 2.33 KB
/
auto-pull-request-by-release.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
name: Auto Pull Request By Release
on:
repository_dispatch:
types: [ webhook ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
tag: v0.0.46
- name: Install Pulumi CLI
uses: pulumi/[email protected]
with:
pulumi-version: 3.117.0
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 21.X
- name: Setup DotNet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.408
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: generate-code
id: generate-code
run: |
version=`curl https://api.github.com/repos/tencentcloudstack/terraform-provider-tencentcloud/releases/latest --header 'Accept: application/vnd.github+json' --header 'Authorization: Bearer ${{secrets.GITHUB_TOKEN}}' | jq .name | tr -d '"' | tr -d 'v'`
echo "version=$version" >> "$GITHUB_OUTPUT"
git clone https://SevenEarth:${{secrets.GITHUB_TOKEN}}@github.com/SevenEarth/pulumi-tencentcloud.git
cd pulumi-tencentcloud
git config --global user.email "[email protected]"
git config --global user.name "SevenEarth"
git checkout -b "feat/sync_provider_v${version}"
cd provider && go get -v github.com/tencentcloudstack/terraform-provider-tencentcloud@v${{ steps.generate-code.outputs.version }} && go mod tidy && cd -
make tfgen
make provider
make build_sdks
cd sdk && go mod tidy && cd -
git add .
git commit -sm "sync provider"
git push origin feat/sync_provider_v${version}
- name: create pull request
run: |
cd pulumi-tencentcloud
gh pr create -B main -H feat/sync_provider_v${{ steps.generate-code.outputs.version }} --title "sync terraform provider" --body "sync terraform provider version to v${{ steps.update-code.outputs.version }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}