2 Commits

Author SHA1 Message Date
eliaskohout 02c5b4ae40 remove binary 2026-04-14 13:03:13 +02:00
eliaskohout 388e24a8df ci: cross-compile binaries in workflow instead of downloading from APK registry
Build and Publish Arch Package / build-arch (amd64, x86_64) (push) Successful in 58s
Build and Publish Arch Package / build-arch (arm64, aarch64) (push) Failing after 1m2s
Build and Publish Docker Image / build-apk (amd64, x86_64) (push) Successful in 52s
Build and Publish Docker Image / build-apk (arm64, aarch64) (push) Failing after 47s
Build and Publish Docker Image / build-and-push-docker (push) Successful in 10m50s
2026-04-14 11:24:37 +02:00
3 changed files with 14 additions and 16 deletions
+11 -9
View File
@@ -68,13 +68,23 @@ jobs:
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/alpine/edge/main"
build-and-push-docker:
needs: build-apk
runs-on:
- ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: src/go.mod
- name: Cross-compile binaries
run: |
cd src
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -trimpath -o ../out/amd64/ax .
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -trimpath -o ../out/arm64/ax .
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
@@ -88,18 +98,10 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract version
id: version
run: |
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ steps.version.outputs.version }}
tags: "g.eliaskohout.de/eliaskohout/axolotl-server:${{gitea.ref_name}},g.eliaskohout.de/eliaskohout/axolotl-server:latest"
+3 -7
View File
@@ -1,14 +1,10 @@
FROM alpine:latest
ARG VERSION
ARG TARGETARCH
RUN apk --no-cache add ca-certificates && \
ARCH=$([ "$TARGETARCH" = "arm64" ] && echo aarch64 || echo x86_64) && \
wget -q "https://g.eliaskohout.de/api/packages/eliaskohout/alpine/edge/main/${ARCH}/axolotl-${VERSION}-r0.apk" \
-O /tmp/axolotl.apk && \
apk add --no-cache --allow-untrusted /tmp/axolotl.apk && \
rm /tmp/axolotl.apk
RUN apk --no-cache add ca-certificates
COPY out/${TARGETARCH}/ax /usr/local/bin/ax
WORKDIR /data
EXPOSE 7000
BIN
View File
Binary file not shown.