Compare commits

..
23 Commits
Author SHA1 Message Date
ThePhaseless 332402652d switch to curl 2025-02-28 23:10:09 +01:00
ThePhaseless 061f0d44de fix latest tagging 2025-02-28 19:28:05 +01:00
ThePhaseless b7914268bc readd test 2025-02-28 19:16:47 +01:00
ThePhaseless 2e8ed3fa9b remove apt caching 2025-02-28 19:16:09 +01:00
ThePhaseless 6f6941e423 lowercase registry 2025-02-28 19:01:06 +01:00
ThePhaseless 25ae01ba71 remove artifact upload 2025-02-28 18:46:48 +01:00
ThePhaseless a065b4b7ae remove invalid argument 2025-02-28 18:43:55 +01:00
ThePhaseless 508568ded7 login before push 2025-02-28 18:36:00 +01:00
ThePhaseless 72f54fc0a9 push and then merge 2025-02-28 18:33:30 +01:00
ThePhaseless 1499cfa3df push before merging 2025-02-28 18:16:39 +01:00
ThePhaseless cf46f481e1 fix bash 2025-02-28 18:04:23 +01:00
ThePhaseless c90b0ab91e echo args 2025-02-28 17:53:04 +01:00
ThePhaseless f5e75b451c push all tags into one 2025-02-28 17:43:57 +01:00
ThePhaseless 0fbae3f9dd bump buildkit cache 2025-02-28 17:14:40 +01:00
ThePhaseless 70f99e40fc tweak labels 2025-02-28 17:09:23 +01:00
ThePhaseless 6a56098a33 add platform to apt cache name 2025-02-28 16:28:32 +01:00
ThePhaseless 7dd1dd633f upload apt and uv cache 2025-02-28 16:24:20 +01:00
ThePhaseless e825e588a8 add qemu back 2025-02-28 16:17:54 +01:00
ThePhaseless 43fe522417 [skip ci] allow sha versions 2025-02-28 16:13:28 +01:00
ThePhaseless ad88b7b505 comment out test 2025-02-28 16:11:59 +01:00
ThePhaseless 78deb9ed34 tweaks to tags 2025-02-28 16:11:10 +01:00
renovate[bot] 65f39b4448 Update dependency fastapi to v0.115.9 (#96)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-28 02:18:00 +00:00
ThePhaseless 565b076c67 cache apt and uv libs 2025-02-28 01:06:25 +01:00
5 changed files with 56 additions and 55 deletions
+46 -45
View File
@@ -64,23 +64,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
# Install the cosign tool except on PR
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
- name: Prepare variables
id: vars
run: |
SURFIX=$(echo ${{ matrix.platform }} | cut -d'/' -f2)
echo "SURFIX=$SURFIX" >> $GITHUB_OUTPUT
# Generate a unique local tag for the image
echo "LOCAL_TAG=${{ github.sha }}-$SURFIX" >> $GITHUB_OUTPUT
# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Set up BuildKit Docker container builder
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login against a Docker registry except on PR
# Log into registry
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
@@ -92,39 +92,25 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,enable=${{ github.ref_type == 'tag' }}, value=latest
tags: type=raw,value=${{ steps.vars.outputs.LOCAL_TAG }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with platform-specific tag
- name: Build and push Docker image
id: build-and-push
# Build and export Docker image for each platform (without pushing)
- name: Build Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
pull: true
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
build-args: GITHUB_BUILD=true,VERSION=${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
# Sign the platform specific image
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
merge:
merge-and-push:
needs: build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
@@ -137,6 +123,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
# Install the cosign tool
- name: Install cosign
uses: sigstore/cosign-installer@v3
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Log into registry
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
@@ -144,6 +139,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract Docker metadata for tagging
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
@@ -154,29 +150,34 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,enable=${{ github.ref_type == 'tag' }}, value=latest
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Install cosign
uses: sigstore/cosign-installer@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Create and push manifest
# Create manifest lists and push
- name: Create and push manifest lists
run: |
TAGS="${{ steps.meta.outputs.tags }}"
for TAG in $TAGS; do
# Create manifest list and push it
docker buildx imagetools create -t $TAG \
$TAG-amd64 \
$TAG-arm64
args=""
image=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
image=${image,,}
# Create tag arguments
for tag in $TAGS; do
args="$args -t $tag"
done
- name: Install cosign
uses: sigstore/cosign-installer@v3
if [ "${{ github.ref_type }}" == "tag" ]; then
args="$args -t ${image}:latest"
fi
- name: Sign the manifest
echo $args
docker buildx imagetools create $args \
${image}:${{github.sha}}-amd64 \
${image}:${{github.sha}}-arm64
# Sign the manifest
- name: Sign the manifests
env:
TAGS: ${{ steps.meta.outputs.tags }}
run: |
+4 -4
View File
@@ -15,13 +15,13 @@ ENV PATH="${HOME}/.local/bin:$PATH"
WORKDIR /app
RUN apt update &&\
apt install -y --no-install-recommends --no-install-suggests xauth xvfb scrot wget chromium chromium-driver ca-certificates
RUN apt-get update && \
apt-get install -y --no-install-recommends --no-install-suggests xauth xvfb scrot curl chromium chromium-driver ca-certificates
ADD https://astral.sh/uv/install.sh install.sh
RUN sh install.sh
COPY pyproject.toml uv.lock ./
RUN uv sync
RUN --mount=type=cache,target=${HOME}/.cache/uv uv sync
# SeleniumBase does not come with an arm64 chromedriver binary
RUN cd .venv/lib/*/site-packages/seleniumbase/drivers && ln -s /usr/bin/chromedriver uc_driver
@@ -30,7 +30,7 @@ COPY . .
FROM base AS test
RUN uv sync --group test
RUN --mount=type=cache,target=${HOME}/.cache/uv uv sync --group test
RUN ./test.sh
FROM base
+1 -1
View File
@@ -8,7 +8,7 @@ version = "0.1.0"
description = "API for getting cookies for Cloudflare challenges"
readme = "README.md"
dependencies = [
"fastapi[standard]==0.115.8",
"fastapi[standard]==0.115.9",
"pyautogui==0.9.54",
"pydantic==2.10.6",
"seleniumbase==4.35.2",
+1 -1
View File
@@ -16,7 +16,7 @@ def get_version_from_env():
"""
version_env = os.getenv("VERSION")
if not version_env or not version_env.startswith("v"):
if not version_env:
return None
return version_env.removeprefix("v")
Generated
+4 -4
View File
@@ -89,7 +89,7 @@ test = [
[package.metadata]
requires-dist = [
{ name = "fastapi", extras = ["standard"], specifier = "==0.115.8" },
{ name = "fastapi", extras = ["standard"], specifier = "==0.115.9" },
{ name = "pyautogui", specifier = "==0.9.54" },
{ name = "pydantic", specifier = "==2.10.6" },
{ name = "seleniumbase", specifier = "==4.35.2" },
@@ -272,16 +272,16 @@ wheels = [
[[package]]
name = "fastapi"
version = "0.115.8"
version = "0.115.9"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "pydantic" },
{ name = "starlette" },
{ name = "typing-extensions" },
]
sdist = { url = "https://files.pythonhosted.org/packages/a2/b2/5a5dc4affdb6661dea100324e19a7721d5dc524b464fe8e366c093fd7d87/fastapi-0.115.8.tar.gz", hash = "sha256:0ce9111231720190473e222cdf0f07f7206ad7e53ea02beb1d2dc36e2f0741e9", size = 295403 }
sdist = { url = "https://files.pythonhosted.org/packages/ab/dd/d854f85e70f7341b29e3fda754f2833aec197bd355f805238758e3bcd8ed/fastapi-0.115.9.tar.gz", hash = "sha256:9d7da3b196c5eed049bc769f9475cd55509a112fbe031c0ef2f53768ae68d13f", size = 293774 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/8f/7d/2d6ce181d7a5f51dedb8c06206cbf0ec026a99bf145edd309f9e17c3282f/fastapi-0.115.8-py3-none-any.whl", hash = "sha256:753a96dd7e036b34eeef8babdfcfe3f28ff79648f86551eb36bfc1b0bf4a8cbf", size = 94814 },
{ url = "https://files.pythonhosted.org/packages/32/b6/7517af5234378518f27ad35a7b24af9591bc500b8c1780929c1295999eb6/fastapi-0.115.9-py3-none-any.whl", hash = "sha256:4a439d7923e4de796bcc88b64e9754340fcd1574673cbd865ba8a99fe0d28c56", size = 94919 },
]
[package.optional-dependencies]