Repository navigation
53 lines (46 loc) · 1.46 KB
/
Copy pathgenerate.yml
File metadata and controls
53 lines (46 loc) · 1.46 KB
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
name: Regenerate SDK from Swagger
on:
repository_dispatch:
types: [swagger-updated]
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch latest swagger.yaml
run: |
curl -sL -H "Authorization: token ${{ secrets.RELEASE_PAT }}" \
"https://raw.githubusercontent.com/buildio/antimony/main/swagger/v1/swagger.yaml" \
-o swagger.yaml
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: Generate SDK
run: |
npx @openapitools/openapi-generator-cli generate \
-i swagger.yaml \
-g ruby \
-o . \
--additional-properties=gemName=build_client
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "Regenerate SDK from latest swagger.yaml"
git push
fi
- name: Dispatch to CLI
if: success()
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.RELEASE_PAT }}
repository: buildio/cli
event-type: sdk-updated
client-payload: '{"sdk": "ruby"}'