feat: enhance rpath-patcher.sh to skip musl libc binaries #41
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: "release" | |
| permissions: {contents: read} | |
| on: { | |
| "push": { | |
| "branches": ["release"], | |
| } | |
| } | |
| jobs: { | |
| build: { | |
| "runs-on": "ubuntu-latest", | |
| "strategy": { | |
| "matrix": { | |
| "architecture": ["x86_64", "x86"], | |
| "version": ["3.15", "3.14", "3.13", "3.12", "3.11", "3.10", "2.7", | |
| "3.15t", "3.14t", "3.13t"], | |
| }, | |
| }, | |
| "steps": [ | |
| { | |
| "name": "Checkout code", | |
| "uses": "actions/checkout@v4", | |
| }, | |
| { | |
| "name": "Set up Docker Buildx", | |
| "uses": "docker/setup-buildx-action@v3", | |
| }, | |
| { | |
| "name": "Build docker image (with GHA layer cache)", | |
| "uses": "docker/build-push-action@v6", | |
| "with": { | |
| "context": ".", | |
| "file": "./${{ matrix.version }}/${{ matrix.architecture }}/Dockerfile", | |
| "tags": "release-${{ github.ref_name }}:${{ matrix.version }}-${{ matrix.architecture }}", | |
| "load": true, | |
| "cache-from": "type=gha,scope=deplibs-${{ matrix.architecture }}", | |
| "cache-to": "type=gha,mode=max,scope=deplibs-${{ matrix.architecture }}", | |
| }, | |
| }, | |
| { | |
| "name": "pip version", | |
| "run": "docker run --rm release-${{ github.ref_name }}:${{ matrix.version }}-${{ matrix.architecture }} /opt/python/bin/pip --version", | |
| }, | |
| { | |
| "name": "Cross-version stdlib smoke", | |
| "run": "docker run --rm \ | |
| -v \"${{ github.workspace }}/ci/smoke_stdlib.py:/tmp/smoke_stdlib.py:ro\" \ | |
| release-${{ github.ref_name }}:${{ matrix.version }}-${{ matrix.architecture }} \ | |
| /opt/python/bin/python /tmp/smoke_stdlib.py", | |
| }, | |
| { | |
| "name": "psutil compatibility smoke test (GIL Py3 only)", | |
| "if": "matrix.version != '2.7' && !endsWith(matrix.version, 't')", | |
| "run": "docker run --rm \ | |
| -v \"${{ github.workspace }}/ci/smoke_psutil.py:/tmp/smoke_psutil.py:ro\" \ | |
| release-${{ github.ref_name }}:${{ matrix.version }}-${{ matrix.architecture }} \ | |
| sh -c '/opt/python/bin/pip install --quiet --no-cache-dir psutil && /opt/python/bin/python /tmp/smoke_psutil.py'", | |
| }, | |
| { | |
| "name": "Save docker image as tar file", | |
| "run": "docker save release-${{ github.ref_name }}:${{ matrix.version }}-${{ matrix.architecture }} > release-${{ matrix.version }}-${{ matrix.architecture }}.tar", | |
| }, | |
| { | |
| "name": "Figure out the /opt/python directory from the tar file", | |
| "run": "./ci/packing_release_tar.sh release-${{ matrix.version }}-${{ matrix.architecture }}.tar", | |
| }, | |
| { | |
| "name": "Gzip to save space", | |
| "run": "sudo apt-get install gzip -y && gzip -9 build/release-${{ matrix.version }}-${{ matrix.architecture }}.tar", | |
| }, | |
| { | |
| "name": "Release the tar file to artifacts", | |
| "uses": "actions/upload-artifact@v4", | |
| "with": { | |
| "name": "release-${{ matrix.version }}-${{ matrix.architecture }}.tar.gz", | |
| "path": "build/release-${{ matrix.version }}-${{ matrix.architecture }}.tar.gz", | |
| }, | |
| }, | |
| ], | |
| }, | |
| release: { | |
| permissions: {contents: write}, | |
| "runs-on": "ubuntu-latest", | |
| "needs": "build", | |
| "steps": [ | |
| { | |
| "name": "Checkout code", | |
| "uses": "actions/checkout@v4", | |
| }, | |
| { | |
| "name": "Create release tag", | |
| "run": "git config --local user.email 'ci@scc-net.tw' && \ | |
| git config --local user.name 'CI' && \ | |
| echo release-$(date '+%Y-%m-%d') > .release_tag && \ | |
| git tag $(cat .release_tag) && \ | |
| git push origin --tags", | |
| "env": { | |
| "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}", | |
| }, | |
| }, | |
| { | |
| "name": "Download release tar files", | |
| "uses": "actions/download-artifact@v4", | |
| "with": { | |
| "path": "artifacts/", | |
| }, | |
| }, | |
| { "name": "Set env TAG_NAME", | |
| "run": "echo ::set-env name=TAG_NAME::$(cat .release_tag)", | |
| "env": { | |
| "ACTIONS_ALLOW_UNSECURE_COMMANDS": "true", | |
| }, | |
| }, | |
| { | |
| "name": "Create GitHub release", | |
| "uses": ncipollo/release-action@v1, | |
| "with": { | |
| "tag": "${{ env.TAG_NAME }}", | |
| "artifacts": "artifacts/*/*.tar.gz", | |
| }, | |
| "env": { | |
| "GITHUB_TOKEN": "${{ secrets.GITHUB_TOKEN }}", | |
| "TAG_NAME": "${{ env.TAG_NAME }}", | |
| }, | |
| }, | |
| ] | |
| } | |
| } |