Release #60
Workflow file for this run
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| required: true | |
| type: string | |
| publish_doc: | |
| description: 'If set to true, then the documentation will be published.' | |
| default: false | |
| required: false | |
| type: boolean | |
| publish_pypi: | |
| default: false | |
| type: boolean | |
| description: "Attempt to publish packages to PyPI" | |
| test: | |
| default: true | |
| description: "Run test release (no docs, publish to test.pypi.org)" | |
| type: boolean | |
| env: | |
| PYMGCLIENT_OVERRIDE_VERSION: "${{ github.event.inputs.version }}" | |
| jobs: | |
| release_tests: | |
| name: Release Package and Test | |
| uses: "./.github/workflows/reusable_buildtest.yml" | |
| with: | |
| test_linux: true | |
| test_windows: true | |
| test_macintosh: true | |
| build_source_dist: true | |
| upload_artifacts: true | |
| version: ${{ inputs.version }} | |
| secrets: inherit | |
| build_docs: | |
| needs: [release_tests] | |
| name: Build Docs | |
| uses: "./.github/workflows/build_docs.yml" | |
| with: | |
| publish_doc: false | |
| secrets: inherit | |
| publish_artifacts: | |
| name: Collect Artifacts | |
| runs-on: ubuntu-24.04 | |
| needs: [release_tests, build_docs] | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| # omit ‘name’ to fetch *every* artifact uploaded earlier | |
| path: ./downloaded-artifacts | |
| - name: Move Artifacts | |
| run: | | |
| mkdir -p dist | |
| mv -v downloaded-artifacts/*/* dist/ | |
| - name: Show contents | |
| run: | | |
| ls dist/ | |
| - name: Publish Package to PyPI | |
| if: ${{ inputs.publish_pypi == true && inputs.test == false }} | |
| uses: pypa/gh-action-pypi-publish@v1.4.2 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| - name: Publish Package to PyPI (TEST) | |
| if: ${{ inputs.publish_pypi == true && inputs.test }} | |
| uses: pypa/gh-action-pypi-publish@v1.4.2 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| repository_url: https://test.pypi.org/legacy/ | |
| verbose: true |