~sbaildon/soju

6ac1fc3396bcbe5e20316d72a0dbb4e0e0906538 — Sean Baildon 2 years ago 5aad4af master
container init
2 files changed, 32 insertions(+), 0 deletions(-)

A .builds/container.yml
A Containerfile
A .builds/container.yml => .builds/container.yml +26 -0
@@ 0,0 1,26 @@
image: alpine/latest
packages:
  - podman
  - buildah
  - qemu-user-static
environment:
  project: soju
  registry: ghcr.io
  gh_user: sbaildon
sources:
  - https://git.sr.ht/~sbaildon/soju
secrets:
  - 9c917ee1-3237-4f74-a735-349281222a55 # github token
tasks:
  - gather_info: |
      cd ${project}
      echo export PROJECT_REVISION=$(git rev-parse --short HEAD) >> ~/.buildenv
  - build: |
      cd ${project}
      buildah build-using-dockerfile \
        --annotation org.opencontainers.image.revision=${PROJECT_REVISION} \
        --annotation org.opencontainers.image.created=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
        --annotation org.opencontainers.image.source=https://git.sr.ht/~sbaildon/${project} \
        --jobs=2 \
        --manifest ${registry}/${gh_user}/${project}:${PROJECT_REVISION} \
        --platform=linux/amd64,linux/arm64 .

A Containerfile => Containerfile +6 -0
@@ 0,0 1,6 @@
FROM alpine:3 AS builder

ARG TARGETARCH

RUN apk add --no-cache go
RUN go build -v ./...