Skip to content

Commit 9dcbb68

Browse files
committed
added python 3.14
1 parent a80f6f8 commit 9dcbb68

2 files changed

Lines changed: 151 additions & 0 deletions

File tree

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Python 3.14 Rust
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.head_ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches: [ "main" ]
10+
# Publish semver tags as releases.
11+
tags: [ 'v*.*.*' ]
12+
pull_request:
13+
branches: [ "main" ]
14+
15+
env:
16+
# Use docker.io for Docker Hub if empty
17+
REGISTRY: ghcr.io
18+
19+
jobs:
20+
21+
# Build job for py314_rust image
22+
build-py314-rust:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
packages: write
27+
id-token: write
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
platform:
32+
- linux/amd64
33+
- linux/arm64
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Inject slug/short variables
39+
uses: rlespinasse/github-slug-action@v4.4.1
40+
41+
- name: Prepare
42+
run: |
43+
platform=${{ matrix.platform }}
44+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
45+
46+
# Install the cosign tool except on PR
47+
- name: Install cosign
48+
if: github.event_name != 'pull_request'
49+
uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
50+
with:
51+
cosign-release: 'v2.1.1'
52+
53+
# Set up QEMU for cross-platform builds
54+
- name: Set up QEMU
55+
uses: docker/setup-qemu-action@v3
56+
57+
# Set up BuildKit Docker container builder
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
61+
# Login against a Docker registry except on PR
62+
- name: Log into registry ${{ env.REGISTRY }}
63+
if: github.event_name != 'pull_request'
64+
uses: docker/login-action@v3
65+
with:
66+
registry: ${{ env.REGISTRY }}
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Build and push by digest
71+
id: build
72+
uses: docker/build-push-action@v6
73+
with:
74+
provenance: false
75+
sbom: false
76+
file: docker/Dockerfile.py314_rust
77+
platforms: ${{ matrix.platform }}
78+
tags: ghcr.io/insight-platform/py314_rust
79+
outputs: type=image,push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
80+
context: .
81+
cache-from: type=gha
82+
cache-to: type=gha,mode=max
83+
84+
- name: Export digest
85+
run: |
86+
mkdir -p ${{ runner.temp }}/digests-py314rust
87+
digest="${{ steps.build.outputs.digest }}"
88+
touch "${{ runner.temp }}/digests-py314rust/${digest#sha256:}"
89+
90+
- name: Upload digest
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: digests-py314rust-${{ env.PLATFORM_PAIR }}
94+
path: ${{ runner.temp }}/digests-py314rust/*
95+
if-no-files-found: error
96+
retention-days: 1
97+
98+
99+
# Merge job for py314_rust image
100+
merge-py314-rust:
101+
runs-on: ubuntu-latest
102+
needs:
103+
- build-py314-rust
104+
if: github.event_name != 'pull_request'
105+
permissions:
106+
contents: read
107+
packages: write
108+
steps:
109+
- name: Inject slug/short variables
110+
uses: rlespinasse/github-slug-action@v4.4.1
111+
112+
- name: Download digests
113+
uses: actions/download-artifact@v4
114+
with:
115+
path: ${{ runner.temp }}/digests-py314rust
116+
pattern: digests-py314rust-*
117+
merge-multiple: true
118+
119+
- name: Set up Docker Buildx
120+
uses: docker/setup-buildx-action@v3
121+
122+
- name: Log into registry ${{ env.REGISTRY }}
123+
uses: docker/login-action@v3
124+
with:
125+
registry: ${{ env.REGISTRY }}
126+
username: ${{ github.actor }}
127+
password: ${{ secrets.GITHUB_TOKEN }}
128+
129+
- name: Create manifest list and push
130+
working-directory: ${{ runner.temp }}/digests-py314rust
131+
run: |
132+
docker buildx imagetools create \
133+
-t ghcr.io/insight-platform/py314_rust:${{ env.GITHUB_REF_SLUG }} \
134+
$(printf 'ghcr.io/insight-platform/py314_rust@sha256:%s ' *)
135+
136+
- name: Inspect image
137+
run: |
138+
docker buildx imagetools inspect ghcr.io/insight-platform/py314_rust:${{ env.GITHUB_REF_SLUG }}

docker/Dockerfile.py314_rust

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:3.14
2+
3+
# Install dependencies needed for Rust
4+
RUN --mount=type=cache,target=/var/lib/apt/lists \
5+
apt-get update && apt-get install -y \
6+
build-essential \
7+
pkg-config \
8+
curl \
9+
git
10+
11+
RUN --mount=type=bind,source=.,target=/opt/scripts bash /opt/scripts/docker/install-basic-deps.sh
12+
13+
WORKDIR /opt

0 commit comments

Comments
 (0)