|
52 | 52 | - xcb
|
53 | 53 | - xcb.cross
|
54 | 54 | runs-on: ubuntu-22.04
|
| 55 | + permissions: |
| 56 | + packages: write |
55 | 57 | steps:
|
56 | 58 | - uses: actions/checkout@v3
|
57 | 59 |
|
|
60 | 62 | with:
|
61 | 63 | python-version: '3.11'
|
62 | 64 |
|
| 65 | + - name: Set up Docker Buildx |
| 66 | + uses: docker/setup-buildx-action@v2 |
| 67 | + |
| 68 | + - name: Login to GitHub Container Registry |
| 69 | + uses: docker/login-action@v2 |
| 70 | + with: |
| 71 | + registry: ghcr.io |
| 72 | + username: ${{ github.actor }} |
| 73 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 74 | + |
| 75 | + - name: Generate Dockerfiles |
| 76 | + run: | |
| 77 | + ./build-linux.py --make-target empty |
| 78 | +
|
63 | 79 | - name: Build Image
|
| 80 | + uses: docker/build-push-action@v4 |
| 81 | + with: |
| 82 | + context: . |
| 83 | + file: build/${{ matrix.image }}.Dockerfile |
| 84 | + labels: org.opencontainers.image.source=https://github.com/${{ github.repository }} |
| 85 | + # Cache from/to the current branch of the current repo as the primary cache key. |
| 86 | + # Cache from the default branch of the current repo so branches can have cache hits. |
| 87 | + # Cache from the default branch of the canonical repo so forks can have cache hits. |
| 88 | + # Ignore errors on cache writes so CI of forks works without a valid GHCR config. |
| 89 | + cache-from: | |
| 90 | + type=registry,ref=ghcr.io/indygreg/${{ github.repository }}:${{ matrix.image }}-${{ github.ref_name }} |
| 91 | + type=registry,ref=ghcr.io/indygreg/${{ github.repository }}:${{ matrix.image }}-main |
| 92 | + type=registry,ref=ghcr.io/indygreg/python-build-standalone:${{ matrix.image }}-main |
| 93 | + cache-to: | |
| 94 | + type=registry,ref=ghcr.io/indygreg/${{ github.repository }}:${{ matrix.image }}-${{ github.ref_name }},ignore-errors=true |
| 95 | + outputs: | |
| 96 | + type=docker,dest=build/image-${{ matrix.image }}.tar |
| 97 | +
|
| 98 | + - name: Compress Image |
64 | 99 | run: |
|
65 |
| - ./build-linux.py --make-target toolchain-image-${{ matrix.image }} |
66 | 100 | zstd -v -T0 -6 --rm build/image-*.tar
|
67 | 101 |
|
68 | 102 | - name: Upload Docker Image
|
|
0 commit comments