-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (83 loc) · 3.01 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
release:
types: [published]
env:
POETRY_VERSION: 1.7.0
GHCR_IMAGE_REPOSITORY: ghcr.io/${{ github.repository_owner }}/poetry
PLATFORMS: linux/amd64,linux/arm64/v8
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
variant:
- bookworm
- slim
include:
- python: "3.12"
is_default_python: true
- variant: bookworm
is_default_variant: true
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v2
with:
platforms: ${{ env.PLATFORMS }}
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Python + Variant: ${{ env.POETRY_VERSION }}-python-${{ matrix.python }}-${{ matrix.variant }}"
uses: docker/build-push-action@v3.1.0
with:
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ env.POETRY_VERSION }}-python-${{ matrix.python }}-${{ matrix.variant }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: ${{ env.PLATFORMS }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}
PYTHON_VERSION=${{ matrix.python }}
VARIANT=${{ matrix.variant }}
- name: "Python + Default Variant: ${{ env.POETRY_VERSION }}-python-${{ matrix.python }}"
uses: docker/build-push-action@v3.1.0
if: matrix.is_default_variant
with:
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ env.POETRY_VERSION }}-python-${{ matrix.python }}
platforms: ${{ env.PLATFORMS }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}
PYTHON_VERSION=${{ matrix.python }}
VARIANT=${{ matrix.variant }}
- name: "Default Python + Variant: ${{ env.POETRY_VERSION }}-${{ matrix.variant }}"
uses: docker/build-push-action@v3.1.0
if: matrix.is_default_python
with:
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ env.POETRY_VERSION }}-${{ matrix.variant }}
platforms: ${{ env.PLATFORMS }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}
PYTHON_VERSION=${{ matrix.python }}
VARIANT=${{ matrix.variant }}
- name: "Default Python + Default Variant: ${{ env.POETRY_VERSION }}"
uses: docker/build-push-action@v3.1.0
if: matrix.is_default_python && matrix.is_default_variant
with:
push: true
tags: ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ env.POETRY_VERSION }}
platforms: ${{ env.PLATFORMS }}
build-args: |
POETRY_VERSION=${{ env.POETRY_VERSION }}
PYTHON_VERSION=${{ matrix.python }}
VARIANT=${{ matrix.variant }}