Skip to content

Generate Rust FattureInCloud Client #24

Generate Rust FattureInCloud Client

Generate Rust FattureInCloud Client #24

name: Generate Rust FattureInCloud Client
on:
repository_dispatch:
types: [update]
workflow_dispatch:
jobs:
generate-rust-sdk:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- id: checkout
name: Checkout repo
uses: actions/checkout@v4
- id: download-openapi-spec
name: Download a file
run: wget https://github.com/fattureincloud/openapi-fattureincloud/raw/master/openapi-enriched.yaml -O fattureincloud-openapi.yaml
- id: generate-client
name: Generate Rust Client
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: rust
openapi-file: fattureincloud-openapi.yaml
config-file: openapi-config.json
- id: install-toml-cli
name: Install Toml
run: cargo install toml-cli
- id: set-repository
name: Set Repository
run: |
toml set ./rust-client/Cargo.toml package.repository https://github.com/teapot-labs/fattureincloud-rs/
- id: read-openapi-version
name: Read OpenAPI Version
run: |
OPENAPI_VERSION=$(yq e '.info.version' ./fattureincloud-openapi.yaml)
echo "openapi_version=$OPENAPI_VERSION" >> $GITHUB_ENV
- id: create-pr
name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: "client-${{ env.openapi_version }}"
delete-branch: true
commit-message: "chore: bumping version to ${{ env.openapi_version }}"
title: "Updating FattureInCloud client to ${{ env.openapi_version }}"
body: "New FattureInCloud client verson ${{ env.openapi_version }} generated by Github Action from OpenAPI Spec ${{ env.openapi_version }}"