Merge branch 'main' of https://github.com/petercarbsmith/ca-biositing #35
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: CD | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: | |
| - "src/ca_biositing/datamodels/**" | |
| - "src/ca_biositing/pipeline/**" | |
| - "src/ca_biositing/webservice/**" | |
| - ".github/workflows/cd.yml" | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "src/ca_biositing/datamodels/**" | |
| - "src/ca_biositing/pipeline/**" | |
| - "src/ca_biositing/webservice/**" | |
| - ".github/workflows/cd.yml" | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: 3 | |
| jobs: | |
| dist: | |
| name: Distribution build (${{ matrix.package }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| package: [datamodels, pipeline, webservice] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build and inspect ${{ matrix.package }} package | |
| uses: hynek/build-and-inspect-python-package@v2 | |
| with: | |
| path: src/ca_biositing/${{ matrix.package }} | |
| upload-name-suffix: -${{ matrix.package }} | |
| env: | |
| # Strip the +gHASH local segment so dev versions like | |
| # 0.2.0.dev4 are valid on TestPyPI/PyPI. | |
| # Tagged releases produce clean versions (e.g. 0.2.0) | |
| # and are unaffected. | |
| HATCH_VCS_LOCAL_SCHEME: no-local-version | |
| publish-testpypi: | |
| needs: [dist] | |
| name: Publish ${{ matrix.package }} to TestPyPI | |
| environment: testpypi | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'push' || github.event_name == 'pull_request' || | |
| github.event_name == 'workflow_dispatch' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: [datamodels, pipeline, webservice] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Packages-${{ matrix.package }} | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| skip-existing: true | |
| publish-pypi: | |
| needs: [dist] | |
| name: Publish ${{ matrix.package }} to PyPI | |
| environment: pypi | |
| permissions: | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: [datamodels, pipeline, webservice] | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Packages-${{ matrix.package }} | |
| path: dist | |
| - uses: pypa/gh-action-pypi-publish@release/v1 |