Skip to content

Commit

Permalink
Dart and Swift SDKs
Browse files Browse the repository at this point in the history
  • Loading branch information
stelzo committed May 10, 2024
1 parent dfb2060 commit d79a917
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/generate-sdks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,93 @@ jobs:
user-email: stelzo@steado.de
target-branch: main

generate-swift-client:
runs-on: ubuntu-latest
name: Generate Swift sdk
steps:
- name: Checkout OpenAPI
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: OpenAPI API Version Print
uses: stelzo/openapi-api-version-print@v1
id: api-version-print
with:
specFile: openapi-3.0.yaml

- name: Generate Swift sdk
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: swift-combine
openapi-file: openapi-3.0.yaml
command-args: --additional-properties=projectName=Dofusdude

- name: Add actions
run: |
cd swift-client
mkdir -p .github/workflows/
printf '%s\n' 'name: Build' 'on:' ' push:' ' branches: [ main ]' ' pull_request:' ' branches: [ main ]' 'jobs:' ' build:' ' runs-on: ubuntu-latest' ' steps:' ' - uses: actions/checkout@v4' ' - name: Set up Swift' ' uses: swift-actions/setup-swift@v2' ' - name: Build' ' run: swift build' ' - name: Test' ' run: swift test' > .github/workflows/build.yml
sed -i 's/\\"/"/g' README.md
cd ..
- name: Pushes to sdk repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY_SWIFT }}
API_TOKEN_GITHUB: ${{ secrets.PUSH_GITHUB_TOKEN }}
with:
source-directory: "swift-client"
destination-github-username: "dofusdude"
destination-repository-name: "dofusdude-swift"
user-email: stelzo@steado.de
target-branch: main

generate-dart-client:
runs-on: ubuntu-latest
name: Generate Dart sdk
steps:
- name: Checkout OpenAPI
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: OpenAPI API Version Print
uses: stelzo/openapi-api-version-print@v1
id: api-version-print
with:
specFile: openapi-3.0.yaml

- name: Generate Dart sdk
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: dart
openapi-file: openapi-3.0.yaml
command-args: --additional-properties=pubAuthor=stelzo,pubAuthorEmail=stelzo@steado.de,pubHomepage=https://github.com/dofusdude,pubLibrary=dofusdude.api,pubName=Dofusdude,pubVersion=${{steps.api-version-print.outputs.apiVersion}},pubRepository=https://github.com/dofusdude/dofusdude-dart

- name: Add actions
run: |
cd dart-client
mkdir -p .github/workflows/
printf '%s\n' 'name: Build' 'on:' ' push:' ' branches: [ main ]' ' pull_request:' ' branches: [ main ]' 'jobs:' ' build:' ' runs-on: ubuntu-latest' ' steps:' ' - uses: actions/checkout@v4' ' - name: Set up Dart' ' uses: dart-lang/setup-dart@v1' ' - name: Install deps' ' run: dart pub get' ' - name: Analyze' ' run: dart analyze' ' - name: Test' ' run: dart test' > .github/workflows/build.yml
printf '%s\n' 'name: Publish' 'on:' ' push:' ' tags:' ' - 'v[0-9]+.[0-9]+.[0-9]+*'' 'jobs:' ' publish:' ' permissions:' ' id-token: write' ' uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1' > .github/workflows/publish.yml
sed -i 's/\\"/"/g' README.md
cd ..
- name: Pushes to sdk repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY_DART }}
API_TOKEN_GITHUB: ${{ secrets.PUSH_GITHUB_TOKEN }}
with:
source-directory: "dart-client"
destination-github-username: "dofusdude"
destination-repository-name: "dofusdude-dart"
user-email: stelzo@steado.de
target-branch: main

generate-go-client:
runs-on: ubuntu-latest
name: Generate go sdk
Expand Down

0 comments on commit d79a917

Please sign in to comment.