forked from NewFuture/DDNS
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (152 loc) · 5.52 KB
/
build-nuitka-docker.yml
File metadata and controls
167 lines (152 loc) · 5.52 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: nuitka builder
run-name: Build nuitka(${{ inputs.nuitka || 'main' }}) docker with python${{ inputs.python || '3.8' }} on ${{github.ref_name}} by @${{ github.actor }}
on:
push:
branches: ["master", "main"]
paths:
- 'docker/*'
- '.github/workflows/build-nuitka-dicker.yml'
workflow_dispatch:
inputs:
python:
description: 'Python version'
required: false
default: '3.8'
nuitka:
description: 'Nuitka version'
required: false
default: 'main'
permissions:
contents: read
packages: write
env:
DOCKER_IMAGE: ghcr.io/newfuture/nuitka-builder
NUITKA_VERSION: ${{ inputs.nuitka || 'main' }}
PYTHON_VERSION: ${{ inputs.python || '3.8' }}
FULL_TAG: ${{ inputs.nuitka || 'main' }}-py${{ inputs.python || '3.8' }}
jobs:
bin-builder:
timeout-minutes: 10
strategy:
matrix:
host: ['amd', 'arm',]
type: ['glibc', 'musl']
env:
platforms: >-
${{ matrix.host == 'amd' && 'linux/386,linux/amd64' ||
matrix.type == 'glibc' && 'linux/arm/v7,linux/arm64/v8' ||
'linux/arm/v6,linux/arm/v7,linux/arm64/v8' }}
environment:
name: preview
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
runs-on: ubuntu-${{ matrix.host == 'arm' && '24.04-arm' || 'latest' }}
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: docker/${{ matrix.type }}.Dockerfile
platforms: ${{ env.platforms }}
target: base-builder
push: true
tags: ${{env.DOCKER_IMAGE}}:${{ matrix.type }}-${{ matrix.host }}
build-args: |
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
NUITKA_VERSION=${{ env.NUITKA_VERSION }}
docker-builder:
timeout-minutes: ${{ matrix.host == 'qemu' && 30 || 10 }}
strategy:
matrix:
include:
- host: amd
platforms: 'linux/386,linux/amd64'
- host: arm
platforms: 'linux/arm/v6,linux/arm/v7,linux/arm64/v8'
- host: qemu
platforms: 'linux/ppc64le,linux/riscv64,linux/s390x'
environment:
name: preview
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
runs-on: ubuntu-${{ matrix.host == 'arm' && '24.04-arm' || 'latest' }}
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
if: matrix.host == 'qemu'
with:
platforms: ${{ matrix.platforms }}
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: ${{ matrix.platforms }}
target: base-builder
push: true
tags: ${{env.DOCKER_IMAGE}}:${{ matrix.host }}
build-args: |
PYTHON_VERSION=${{ env.PYTHON_VERSION }}
NUITKA_VERSION=${{ env.NUITKA_VERSION }}
merge-bin-builder:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [bin-builder]
strategy:
matrix:
type: ['glibc', 'musl']
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: preview
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Merge images
run: |
set -ex
docker buildx imagetools create \
--tag ${{env.DOCKER_IMAGE}}:${{matrix.type}}-${{ github.ref_name }} \
--tag ${{env.DOCKER_IMAGE}}:${{ env.FULL_TAG }}-${{matrix.type}} \
${{env.DOCKER_IMAGE}}:${{matrix.type}}-amd \
${{env.DOCKER_IMAGE}}:${{matrix.type}}-arm \
--annotation "index:org.opencontainers.image.description={{matrix.type}} Nuitka Builder Image (multi-arch)"
merge-docker-builder:
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [docker-builder]
runs-on: ubuntu-latest
timeout-minutes: 5
environment:
name: preview
url: https://github.com/NewFuture/DDNS/pkgs/container/nuitka-builder/
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-buildx-action@v3
- name: Merge images
run: |
set -ex
docker buildx imagetools create \
--tag ${{env.DOCKER_IMAGE}} \
--tag ${{env.DOCKER_IMAGE}}:${{ github.ref_name }} \
--tag ${{env.DOCKER_IMAGE}}:${{ env.FULL_TAG }} \
${{env.DOCKER_IMAGE}}:amd \
${{env.DOCKER_IMAGE}}:arm \
${{env.DOCKER_IMAGE}}:qemu \
--annotation "index:org.opencontainers.image.description=Alpine Nuitka Builder Image (multi-arch)"