INTPYTHON-582 Add release workflows #6
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: Python Dist | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+.post[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" | |
| workflow_dispatch: | |
| pull_request: | |
| workflow_call: | |
| inputs: | |
| ref: | |
| required: true | |
| type: string | |
| concurrency: | |
| group: dist-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -eux {0} | |
| jobs: | |
| make_dist: | |
| name: Make Dist | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@v6 | |
| with: | |
| # Build sdist on lowest supported Python | |
| python-version: '3.10' | |
| - name: Install python requirements | |
| run: | | |
| python -m pip install uv rust-just build twine | |
| - name: Build Dist | |
| run: | | |
| python -m build . | |
| - name: Test SDist | |
| run: | | |
| python -m twine check --strict dist/*.* | |
| python -m pip install dist/*.gz | |
| cd .. | |
| python -c "import django_mongodb_extensions" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: "dist" | |
| path: ./dist/*.* | |
| collect_dist: | |
| runs-on: ubuntu-latest | |
| needs: [make_dist] | |
| name: Download Dist | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Download all workflow run artifacts | |
| uses: actions/download-artifact@v5 | |
| - name: Flatten directory | |
| working-directory: . | |
| run: | | |
| find . -mindepth 2 -type f -exec mv {} . \; | |
| find . -type d -empty -delete | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: all-dist-${{ github.run_id }} | |
| path: "./*" |