s390x Wheel Builder #13
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
| # =============================================================== | |
| # s390x Wheel Builder | |
| # =============================================================== | |
| # | |
| # Builds native Python wheels for packages that lack pre-built | |
| # s390x binaries on PyPI, then pushes the resulting container | |
| # image to ghcr.io so downstream Containerfile stages can | |
| # COPY the wheels out. | |
| # | |
| # Trigger: manual only (workflow_dispatch) | |
| # =============================================================== | |
| name: s390x Wheel Builder | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "infra/s390x/Containerfile" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| - ".github/workflows/s390x-wheels.yml" | |
| schedule: | |
| - cron: "0 2 * * *" | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| REGISTRY: ghcr.io | |
| # Pushed as a separate "-s390x-wheels" image alongside the main repo image | |
| IMAGE_NAME: ${{ github.repository }}-s390x-wheels | |
| jobs: | |
| build-and-push: | |
| name: Build s390x wheels | |
| runs-on: ubuntu-24.04-s390x | |
| timeout-minutes: 120 | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | |
| with: | |
| persist-credentials: false | |
| - name: Set image name lowercase | |
| run: | | |
| IMAGE_NAME_LC=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]') | |
| echo "IMAGE_NAME_LC=${IMAGE_NAME_LC}" >> "${GITHUB_ENV}" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_LC }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=sha,format=long | |
| - name: Build and push | |
| uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 | |
| with: | |
| context: infra/s390x | |
| file: infra/s390x/Containerfile | |
| platforms: linux/s390x | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=s390x-wheels | |
| cache-to: type=gha,mode=max,scope=s390x-wheels | |
| notify-failure: | |
| name: Send Slack failure notification | |
| needs: build-and-push | |
| if: failure() && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Send Slack notification | |
| uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3 | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "text": ":x: *s390x wheel Builder* failed on `main`", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": ":x: *s390x Wheel Builder* failed on `main`\n• *Commit:* <${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|`${{ github.sha }}`>\n• *Actor:* `${{ github.actor }}`\n• *Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View run>" | |
| } | |
| } | |
| ] | |
| } |