SDKgen #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SDKgen | |
on: | |
workflow_dispatch: | |
inputs: | |
typehub_message: | |
description: "The TypeHub commit message on commit" | |
required: false | |
typehub_version: | |
description: "The TypeHub version on tag" | |
required: false | |
typehub_changelog: | |
description: "The TypeHub changelog on tag" | |
required: false | |
permissions: | |
contents: 'write' | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: apioo/sdkgen-generator-action@v0.2.1 | |
with: | |
client_id: '${{ secrets.SDKGEN_CLIENT_ID }}' | |
client_secret: '${{ secrets.SDKGEN_CLIENT_SECRET }}' | |
typehub_message: '${{ inputs.typehub_message }}' | |
typehub_version: '${{ inputs.typehub_version }}' | |
typehub_changelog: '${{ inputs.typehub_changelog }}' | |
build: | |
name: Build distribution | |
if: "${{ inputs.typehub_version != '' }}" | |
needs: generate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Set version | |
run: sed -i 's/0.0.0/${{ inputs.typehub_version }}/g' ./pyproject.toml | |
- name: Install pypa/build | |
run: >- | |
python3 -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: python3 -m build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
publish-to-pypi: | |
name: Publish to PyPI | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/fusio-sdk | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v3 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: "${{ secrets.PYPI_TOKEN }}" |