All checks were successful
Update Client / update-client (push) Successful in 12s
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-go](https://github.com/actions/setup-go) ([changelog](4dc6199c7b..7a3fe6cf4c)) | action | digest | `4dc6199` → `7a3fe6c` |
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43MS4wIiwidXBkYXRlZEluVmVyIjoiNDIuNzQuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYWN0aW9uIiwiZGVwcyJdfQ==-->
Reviewed-on: #10
Reviewed-by: t.behrendt <t.behrendt@noreply.localhost>
Co-authored-by: Renovate Bot <renovate@t00n.de>
Co-committed-by: Renovate Bot <renovate@t00n.de>
68 lines
2.3 KiB
YAML
68 lines
2.3 KiB
YAML
name: Update Client
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "@weekly"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-client:
|
|
runs-on:
|
|
- ubuntu-latest
|
|
- linux_amd64
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
|
|
- name: Setup Go
|
|
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
|
|
with:
|
|
go-version: "1.25.6"
|
|
- name: Install yq
|
|
run: |
|
|
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
|
|
sudo chmod +x /usr/bin/yq
|
|
- name: Install openapi codegen
|
|
run: go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.4.1
|
|
- name: Download Ionos DNS OpenAPI Spec
|
|
run: curl -sL https://developer.hosting.ionos.com/assets/kms-swagger-specs/dns.yaml -o openapi.yaml
|
|
- name: Compare OpenAPI Versions
|
|
id: version_check
|
|
run: |
|
|
NEW_VERSION=$(yq -r '.info.version' openapi.yaml)
|
|
if [ -f openapi_spec.yaml ]; then
|
|
OLD_VERSION=$(yq -r '.info.version' openapi_spec.yaml)
|
|
else
|
|
OLD_VERSION="0.0.0"
|
|
fi
|
|
echo "New Version: $NEW_VERSION"
|
|
echo "Old Version: $OLD_VERSION"
|
|
if [ "$NEW_VERSION" != "$OLD_VERSION" ]; then
|
|
echo "New version detected"
|
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
|
|
else
|
|
echo "No new version detected"
|
|
exit 0
|
|
fi
|
|
- name: Generate OpenAPI Client
|
|
if: env.NEW_VERSION
|
|
run: |
|
|
rm -rf *.go
|
|
oapi-codegen --config cfg.yaml openapi.yaml
|
|
go mod tidy
|
|
- name: Update Local OpenAPI Spec
|
|
if: env.NEW_VERSION
|
|
run: mv openapi.yaml openapi_spec.yaml
|
|
- name: Commit and Push Changes
|
|
if: env.NEW_VERSION
|
|
run: |
|
|
git config user.name "OpenAPI Bot"
|
|
git config user.email "t.behrendt@t00n.de"
|
|
git add .
|
|
git commit -m "Update OpenAPI client to version $NEW_VERSION"
|
|
git push
|
|
- name: Create Tag
|
|
if: env.NEW_VERSION
|
|
run: |
|
|
git tag -a "v$NEW_VERSION" -m "Update OpenAPI client to version $NEW_VERSION"
|
|
git push origin "v$NEW_VERSION"
|