-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (84 loc) · 2.84 KB
/
sdk-pr.yaml
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
name: Update SDK Repo Workflow
on:
push:
branches:
- main
workflow_dispatch:
env:
GO_VERSION: "1.22"
JAVA_VERSION: "11"
jobs:
main-go:
name: "[Go] Update SDK Repo"
runs-on: ubuntu-latest
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Checkout generator repo
uses: actions/checkout@v3
with:
repository: "stackitcloud/stackit-sdk-generator"
ref: "main"
- name: Build
uses: ./.github/actions/build/go
with:
go-version: ${{ env.GO_VERSION }}
- name: Download OAS
run: make download-oas
- name: Generate SDK
run: make generate-sdk
- name: Push SDK
env:
GH_REPO: "stackitcloud/stackit-sdk-go"
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
run: |
scripts/sdk-create-pr.sh "oas-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
main-python:
name: "[Python] Update SDK Repo"
runs-on: ubuntu-latest
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: ${{ env.JAVA_VERSION }}
- name: Checkout generator repo
uses: actions/checkout@v3
with:
repository: "stackitcloud/stackit-sdk-generator"
ref: "main"
- name: Build
uses: ./.github/actions/build/python
with:
go-version: ${{ env.GO_VERSION }}
- name: Download OAS
run: make download-oas
- name: Generate SDK
run: make generate-sdk LANGUAGE=python
- name: Install Python SDK
working-directory: ./sdk-repo-updated
run: |
pip install poetry
poetry config virtualenvs.create false
python -m venv ${{ runner.temp }}/.venv
source ${{ runner.temp }}/.venv/bin/activate
make install-dev
- name: Push Python SDK
env:
GH_REPO: "stackitcloud/stackit-sdk-python"
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
run: |
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" "[email protected]:stackitcloud/stackit-sdk-python.git" "python"