Skip to content

Commit

Permalink
Merge pull request #84 from mxenabled/mc/simplify_generate_sdk
Browse files Browse the repository at this point in the history
Simplify generate sdk workflow
  • Loading branch information
mcoats13 authored May 9, 2023
2 parents b69e214 + 287847e commit bcd0cbc
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 121 deletions.
121 changes: 0 additions & 121 deletions .github/workflows/generate_publish_release.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/generate_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Generate SDK

on:
repository_dispatch:
types: [generate_sdk]

jobs:
Generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
- name: Bump version
id: bump_version
run: echo "::set-output name=version::$(ruby .github/version.rb ${{ github.event.client_payload.version }})"
- name: Clean repo
run: ruby .github/clean.rb
- name: Install openapi-generator-cli
run: |
npm install @openapitools/openapi-generator-cli -g
openapi-generator-cli version-manager set 5.4.0
- run: |
openapi-generator-cli generate \
-i https://raw.githubusercontent.com/mxenabled/openapi/master/openapi/mx_platform_api.yml \
-g ruby \
-c ./openapi/config.yml \
-t ./openapi/templates
- name: Checkout master
run: git checkout master
- name: Create commit
run: |
git config user.name "devexperience"
git config user.email "[email protected]"
git add .
git commit -m "Generated version ${{ steps.bump_version.outputs.version }}
This commit was automatically created by a GitHub Action to generate version ${{ steps.bump_version.outputs.version }} of this library."
- name: Push to master
run: git push origin master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Slack notification
uses: ravsamhq/notify-slack-action@v2
if: always()
with:
status: ${{ job.status }}
token: ${{ secrets.GITHUB_TOKEN }}
notification_title: "{repo}: {workflow} workflow"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
footer: "<{workflow_url}|View Workflow>"
notify_when: "failure"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit bcd0cbc

Please sign in to comment.