Continuous Delivery of Algorand Python Testing package #54
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: Continuous Delivery of Algorand Python Testing package | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "docs/**" | |
| - "scripts/**" | |
| - "examples/**" | |
| - "tests/**" | |
| workflow_dispatch: | |
| inputs: | |
| prerelease: | |
| description: "Prerelease?" | |
| type: boolean | |
| required: true | |
| default: true | |
| dry_run: | |
| description: "Dry Run? If true, won't commit or publish anything" | |
| type: boolean | |
| required: true | |
| default: false | |
| concurrency: release | |
| permissions: | |
| contents: write | |
| packages: read | |
| jobs: | |
| release: | |
| name: Release `algorand-python-testing` package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| contents: write | |
| packages: read | |
| env: | |
| DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' && '--noop' || '' }} | |
| PRERELEASE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease || 'true' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install hatch | |
| run: pipx install hatch | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| - name: Start LocalNet | |
| run: pipx install algokit && algokit localnet start | |
| - name: Check pre-commits | |
| run: hatch run check | |
| - name: Check pre-commits (examples) | |
| run: hatch run examples:check | |
| - name: Build wheels | |
| run: hatch build | |
| - name: Run tests (codebase) | |
| run: hatch run tests | |
| - name: Run tests (examples) | |
| run: hatch run examples:tests | |
| - name: Publish to PyPI | |
| if: ${{ !inputs.dry_run }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist | |
| - uses: actions/upload-artifact@v4 # upload artifacts so they are retained on the job | |
| with: | |
| path: dist |