fork of https://f-hub.org/XMPP/xmpp-discord-bridge

attempt 1 at adding a workflow

zenfyr.dev 14d5df36 3946ccc5

verified
+86 -6
+22
.dockerignore
··· 1 + # Python-generated files 2 + __pycache__/ 3 + *.py[oc] 4 + build/ 5 + dist/ 6 + wheels/ 7 + *.egg-info 8 + 9 + # Virtual environments 10 + .venv 11 + 12 + # Random junk 13 + .git 14 + .tangled 15 + .woodpecker 16 + .gitignore 17 + .env 18 + .env.* 19 + .DS_Store 20 + data/ 21 + docs/ 22 + contrib/
+50
.tangled/workflows/build-images.yml
··· 1 + when: 2 + - event: ["push", "manual"] 3 + branch: main 4 + 5 + engine: nixery 6 + 7 + dependencies: 8 + nixpkgs: 9 + - kaniko 10 + - regctl 11 + 12 + environment: 13 + GHCR_USER: "zenfyrdev" 14 + 15 + steps: 16 + - name: create auth configs 17 + command: | 18 + mkdir -p $HOME/.docker $HOME/.regctl 19 + 20 + cat > $HOME/.docker/config.json <<EOF 21 + {"auths": {"ghcr.io": {"auth": "$(echo -n "$GHCR_USER:$GHCR_PAT" | base64 -w0)"}}} 22 + EOF 23 + 24 + cat > $HOME/.regctl/config.json <<EOF 25 + {"hosts": {"ghcr.io": {"user": "$GHCR_USER","pass": "$GHCR_PAT"}}} 26 + EOF 27 + 28 + - name: build amd64 29 + command: | 30 + executor \ 31 + --context=dir://. \ 32 + --dockerfile=contrib/Dockerfile \ 33 + --verbosity=info \ 34 + --destination=ghcr.io/$GHCR_USER/xmpp-discord-bridge:amd64-latest \ 35 + --custom-platform=linux/amd64 36 + 37 + - name: build arm64 38 + command: | 39 + executor \ 40 + --context=dir://. \ 41 + --dockerfile=contrib/Dockerfile \ 42 + --verbosity=info \ 43 + --destination=ghcr.io/$GHCR_USER/xmpp-discord-bridge:arm64-latest \ 44 + --custom-platform=linux/arm64 45 + 46 + - name: tag latest artifact 47 + command: | 48 + regctl index create ghcr.io/$GHCR_USER/xmpp-discord-bridge:latest \ 49 + --ref ghcr.io/$GHCR_USER/xmpp-discord-bridge:amd64-latest --platform linux/amd64 \ 50 + --ref ghcr.io/$GHCR_USER/xmpp-discord-bridge:arm64-latest --platform linux/arm64
+14 -6
contrib/Dockerfile
··· 1 - FROM python:3.11-alpine 1 + FROM python:3.11-alpine AS builder 2 2 3 3 COPY . /build 4 4 WORKDIR /build 5 - RUN apk add --no-cache git cargo libgcc && \ 6 - pip3 install --no-cache-dir setuptools wheel && \ 7 - pip3 install . && \ 8 - apk del git cargo && \ 9 - rm -rf /build 5 + 6 + RUN apk add --no-cache git cargo libgcc 7 + RUN pip3 install --no-cache-dir setuptools wheel 8 + RUN pip3 install . 9 + RUN apk del git cargo && rm -rf /build 10 + 11 + FROM python:3.11-alpine 12 + 13 + RUN adduser -D -u 1000 app 14 + USER app 15 + 16 + COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages 17 + COPY --from=builder /usr/local/bin/xmpp-discord-bridge /usr/local/bin/ 10 18 11 19 ENTRYPOINT ["xmpp-discord-bridge"]