Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.13.0 in /.github/workflows #836
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: on-push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - uses: pre-commit/[email protected] | |
| combine-environments: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| - name: Install conda-merge | |
| run: | | |
| python -m pip install conda-merge | |
| - name: Combine environments | |
| run: | | |
| for SUFFIX in ci integration; do | |
| conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit | |
| done | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: combined-environments | |
| path: ci/combined-environment-*.yml | |
| unit-tests: | |
| name: unit-tests | |
| needs: combine-environments | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.13'] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: combined-environments | |
| path: ci | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| - uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: ci/combined-environment-ci.yml | |
| environment-name: DEVELOP | |
| cache-environment: true | |
| cache-environment-key: environment-${{ steps.date.outputs.date }} | |
| cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
| create-args: >- | |
| python=${{ matrix.python-version }} | |
| - name: Install uv | |
| run: | | |
| python -m pip install uv | |
| - name: Run tests | |
| run: | | |
| make unit-tests COV_REPORT=xml | |
| type-check: | |
| needs: [combine-environments, unit-tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: combined-environments | |
| path: ci | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| - uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| environment-file: ci/combined-environment-ci.yml | |
| environment-name: DEVELOP | |
| cache-environment: true | |
| cache-environment-key: environment-${{ steps.date.outputs.date }} | |
| cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
| create-args: >- | |
| python=3.13 | |
| - name: Install uv | |
| run: | | |
| python -m pip install uv | |
| - name: Run code quality checks | |
| run: | | |
| make type-check | |
| # docs-build: | |
| # needs: [combine-environments, unit-tests] | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v5 | |
| # - uses: actions/download-artifact@v5 | |
| # with: | |
| # name: combined-environments | |
| # path: ci | |
| # - name: Get current date | |
| # id: date | |
| # run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| # - uses: mamba-org/setup-micromamba@v2 | |
| # with: | |
| # environment-file: ci/combined-environment-ci.yml | |
| # environment-name: DEVELOP | |
| # cache-environment: true | |
| # cache-environment-key: environment-${{ steps.date.outputs.date }} | |
| # cache-downloads-key: downloads-${{ steps.date.outputs.date }} | |
| # create-args: >- | |
| # python=3.13 | |
| # - name: Install uv | |
| # run: | | |
| # python -m pip install uv | |
| # - name: Build documentation | |
| # run: | | |
| # make docs-build | |
| integration-tests: | |
| needs: [unit-tests] | |
| if: | | |
| success() && true | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install the project | |
| run: uv sync --locked --dev | |
| - name: Run tests | |
| run: uv run pytest -vv | |
| minver-tests: | |
| needs: [unit-tests] | |
| if: | | |
| success() && true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install uv and set the python version | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.10" | |
| - name: Install the project | |
| run: uv sync --dev --resolution lowest-direct | |
| - name: Run tests | |
| run: uv run pytest -vv | |
| distribution: | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, type-check, integration-tests] | |
| if: | | |
| always() && | |
| needs.unit-tests.result == 'success' && | |
| needs.type-check.result == 'success' && | |
| needs.docs-build.result == 'success' && | |
| (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'skipped') | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install package | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build twine | |
| - name: Build distribution | |
| run: | | |
| python -m build | |
| - name: Check wheels | |
| run: | | |
| cd dist || exit | |
| python -m pip install xarray_sentinel*.whl || exit | |
| python -m twine check --strict * || exit | |
| python -c "import xarray_sentinel" || exit | |
| cd .. | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: distribution | |
| path: dist | |
| upload-to-pypi: | |
| runs-on: ubuntu-latest | |
| needs: distribution | |
| if: | | |
| always() && true && | |
| needs.distribution.result == 'success' && | |
| github.event_name == 'push' && | |
| startsWith(github.ref, 'refs/tags') | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/xarray-sentinel | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publish | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: distribution | |
| path: dist | |
| - uses: pypa/[email protected] | |
| with: | |
| verbose: true |