Regenerate Python Library #66
This file contains hidden or 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: Regenerate Python Library | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| library_version: | |
| description: 'The version of the new library' | |
| required: true | |
| api_version: | |
| description: 'The corresponding version of the API' | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install poetry | |
| poetry lock | |
| poetry install --no-root | |
| - name: Delete folder | |
| run: | | |
| rm -rf meraki | |
| - name: Regenerate Python Library | |
| run: | | |
| poetry run python generator/generate_library.py -g true -v ${{ github.event.inputs.library_version }} -a ${{ github.event.inputs.api_version }} -o ${{ secrets.TEST_ORG_ID }} -k ${{ secrets.TEST_ORG_API_KEY }} | |
| - name: Set new version for Poetry | |
| run: | | |
| sed -i "s/^version = \".*\"/version = \"${{ github.event.inputs.library_version }}\"/" pyproject.toml | |
| poetry lock | |
| - name: Commit changes to new branch | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| author_name: GitHub Action | |
| author_email: [email protected] | |
| message: Auto-generated library v${{ github.event.inputs.library_version }} for API v${{ github.event.inputs.api_version }}. | |
| new_branch: release |