Modernize Python packaging: migrate from setup.cfg to pyproject.toml … #190
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: Wheel + Docker publish | |
| on: | |
| push: | |
| branches: | |
| - next | |
| - qa | |
| - main | |
| env: | |
| # Use docker.io for Docker Hub if empty | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pixi | |
| uses: prefix-dev/[email protected] | |
| - name: Build wheels | |
| run: make wheel/all | |
| - name: Create tag version | |
| id: tag | |
| run: echo "tag=$(pixi run versioningit src/webmon_app)" >> $GITHUB_OUTPUT | |
| - name: Create latest tag version | |
| id: latest_tag | |
| run: | | |
| case ${{ github.ref }} in | |
| refs/heads/next) | |
| echo "latest_tag=latest-dev" >> $GITHUB_OUTPUT | |
| ;; | |
| refs/heads/qa) | |
| echo "latest_tag=latest-test" >> $GITHUB_OUTPUT | |
| ;; | |
| refs/heads/main) | |
| echo "latest_tag=latest-prod" >> $GITHUB_OUTPUT | |
| ;; | |
| *) | |
| exit 1 | |
| ;; | |
| esac | |
| - name: Upload wheels | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| files: src/*/dist/*.whl | |
| - name: Check tag names | |
| run: | | |
| echo ${{ steps.latest_tag.outputs.latest_tag }} | |
| echo ${{ steps.tag.outputs.tag }} | |
| - name: Build test data for autoreducer | |
| run: make SNSdata.tar.gz | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push webmonchow | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.webmonchow | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository }}/webmonchow:${{ steps.latest_tag.outputs.latest_tag }} | |
| ${{ env.REGISTRY }}/${{ github.repository }}/webmonchow:${{ steps.tag.outputs.tag }} | |
| push: true | |
| - name: Build and push Autoreducer | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.autoreducer | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository }}/autoreducer:${{ steps.latest_tag.outputs.latest_tag }} | |
| ${{ env.REGISTRY }}/${{ github.repository }}/autoreducer:${{ steps.tag.outputs.tag }} | |
| push: true | |
| - name: Build and push Dasmon | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.dasmon | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository }}/dasmon:${{ steps.latest_tag.outputs.latest_tag }} | |
| ${{ env.REGISTRY }}/${{ github.repository }}/dasmon:${{ steps.tag.outputs.tag }} | |
| push: true | |
| - name: Build and push Webmon | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.webmon | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository }}/webmon:${{ steps.latest_tag.outputs.latest_tag }} | |
| ${{ env.REGISTRY }}/${{ github.repository }}/webmon:${{ steps.tag.outputs.tag }} | |
| push: true | |
| - name: Build and push Workflow | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile.workflow | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ github.repository }}/workflow:${{ steps.latest_tag.outputs.latest_tag }} | |
| ${{ env.REGISTRY }}/${{ github.repository }}/workflow:${{ steps.tag.outputs.tag }} | |
| push: true |