12
12
required : true
13
13
type : string
14
14
targets :
15
- description : ' Targets to update. If not provided, all targets will be updated.'
15
+ description : ' Targets to update.'
16
+ required : true
16
17
type : choice
17
18
options :
18
19
- mistralai-sdk
19
20
- mistralai-azure-sdk
20
21
- mistralai-gcp-sdk
22
+ - all
21
23
22
24
jobs :
23
25
update-sdks :
@@ -40,16 +42,25 @@ jobs:
40
42
41
43
- name : Install dependencies
42
44
run : |
45
+ cp README.md README-PYPI.md
43
46
poetry install --with dev
44
47
48
+ - name : Install Speakeasy CLI
49
+ run : |
50
+ curl -fsSL https://go.speakeasy.com/cli-install.sh | sh
51
+ speakeasy --version
52
+
45
53
- name : Configure Git
46
54
run : |
47
55
git config --local user.email "[email protected] "
48
56
git config --local user.name "GitHub Action"
57
+ git config --local --type bool push.autoSetupRemote true
49
58
50
59
- name : Create branch
51
60
run : |
52
- git checkout -b update-speakeasy-to-${{ github.event.inputs.version }}-${{ github.run_id }}
61
+ TIMESTAMP=$(date +%Y%m%d-%H%M%S)
62
+ echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV
63
+ git checkout -b update-speakeasy-to-${{ github.event.inputs.version }}-$TIMESTAMP
53
64
54
65
- name : Update Speakeasy SDKs
55
66
run : |
62
73
poetry run inv update-speakeasy \
63
74
--version "${{ github.event.inputs.version }}" \
64
75
$TARGETS_ARGS
76
+ env :
77
+ SPEAKEASY_API_KEY : ${{ secrets.SPEAKEASY_API_KEY }}
65
78
66
79
- name : Check for changes
67
80
id : check-changes
@@ -79,48 +92,22 @@ jobs:
79
92
if : steps.check-changes.outputs.has_changes == 'true'
80
93
run : |
81
94
git add .
82
- git commit -m "Update Speakeasy SDKs to version ${{ github.event.inputs.version }}
83
-
84
- Targets updated: ${{ github.event.inputs.targets }}
85
-
86
- This PR was automatically generated by the Update Speakeasy workflow."
87
- git push origin ${{ github.event.inputs.branch_name }}
95
+ git commit -m "Update Speakeasy SDKs to version ${{ github.event.inputs.version }}"
96
+ git push origin update-speakeasy-to-${{ github.event.inputs.version }}-${{ env.TIMESTAMP }}
88
97
89
98
- name : Create Pull Request
90
99
if : steps.check-changes.outputs.has_changes == 'true'
91
- uses : peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
92
- with :
93
- token : ${{ secrets.GITHUB_TOKEN }}
94
- base : main
95
- branch : ${{ github.event.inputs.branch_name }}
96
- title : " Update Speakeasy SDKs to version ${{ github.event.inputs.version }}"
97
- body : |
98
- ## Summary
99
-
100
- This PR updates the Speakeasy SDKs to version `${{ github.event.inputs.version }}`.
101
-
102
- ## Changes
103
-
104
- - **Version**: Updated to `${{ github.event.inputs.version }}`
105
- - **Targets**: ${{ github.event.inputs.targets }}
106
-
107
- ## Files Updated
108
-
109
- The following SDK files have been regenerated:
110
- - Generated SDK code files
111
- - Updated dependencies and configurations
112
-
113
- ## How to Review
114
-
115
- 1. Check that the generated files look correct
116
- 2. Verify that the version update is appropriate
117
- 3. Ensure all target SDKs are properly updated
118
-
119
- ---
120
-
121
- *This PR was automatically generated by the [Update Speakeasy workflow](.github/workflows/update_speakeasy.yaml)*
122
- labels : automated
123
- assignees : ${{ github.actor }}
100
+ run : |
101
+ gh pr create \
102
+ --base main \
103
+ --head update-speakeasy-to-${{ github.event.inputs.version }}-${{ env.TIMESTAMP }} \
104
+ --title "Update Speakeasy SDKs to version ${{ github.event.inputs.version }}" \
105
+ --body "This PR updates the Speakeasy SDKs to version ${{ github.event.inputs.version }}. It was automatically generated by the [Update Speakeasy workflow](.github/workflows/update_speakeasy.yaml)." \
106
+ --label automated \
107
+ --label speakeasy-update \
108
+ --assignee ${{ github.actor }}
109
+ env :
110
+ GITHUB_TOKEN : ${{ secrets.SPEAKEASY_WORKFLOW_GITHUB_PAT }}
124
111
125
112
- name : Comment on workflow run
126
113
if : steps.check-changes.outputs.has_changes == 'false'
0 commit comments