Multiarch
Some checks failed
Run tests / build (amd64, , linux) (push) Has been cancelled
Run tests / build (arm, 6, linux) (push) Has been cancelled
Run tests / build (arm, 7, linux) (push) Has been cancelled
Run tests / build (stable) (push) Has been cancelled
Run tests / test (stable) (push) Has been cancelled

This commit is contained in:
2026-02-23 12:19:56 +01:00
parent c7f0e5cdb9
commit 0bf5f8b10b
3 changed files with 31 additions and 6 deletions

View File

@@ -28,6 +28,16 @@ jobs:
strategy:
matrix:
go: [stable]
include:
- goos: linux
goarch: amd64
goarm: ""
- goos: linux
goarch: arm
goarm: "6"
- goos: linux
goarch: arm
goarm: "7"
steps:
- name: Checkout code
uses: actions/checkout@v6
@@ -35,14 +45,21 @@ jobs:
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Set target variables
run: |
echo "GOOS=${{ matrix.goos }}" >> $GITHUB_ENV
echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
if [ -n "${{ matrix.goarm }}" ]; then
echo "GOARM=${{ matrix.goarm }}" >> $GITHUB_ENV
fi
- name: Download modules
run: go mod download
- name: Make build directory
run: mkdir -p build
- name: Build hamview-collector
run: go build -o build/ -v ./cmd/hamview-collector
- name: Build hamview-receiver
run: go build -o build/ -v ./cmd/hamview-receiver
- name: Build hamview-collector (${{ matrix.goos}} ${{ matrix.goarch }}${{ matrix.goarm }})
run: go build -o build/hamview-collector.${{ matrix.goarch }}${{ matrix.goarm }} -v ./cmd/hamview-collector
- name: Build hamview-receiver (${{ matrix.goos}} ${{ matrix.goarch }}${{ matrix.goarm }})
run: go build -o build/hamview-receiver.${{ matrix.goarch }}${{ matrix.goarm }} -v ./cmd/hamview-receiver
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Show env
@@ -59,9 +76,15 @@ jobs:
push: true
tags: hamview/collector:latest
context: cmd/hamview-collector
platforms: |
linux/amd64
- name: Build and push receiver container
uses: docker/build-push-action@v6
with:
push: true
tags: hamview/receiver:latest
context: cmd/hamview-receiver
platforms: |
linux/amd64
linux/arm/v6
linux/arm/v7

View File

@@ -1,6 +1,6 @@
FROM alpine:3
WORKDIR /opt/hamview
COPY ../../etc /etc/hamview
COPY ../../build/hamview-collector /opt/hamview/bin/hamview-collector
COPY ../../build/hamview-collector-amd64 /opt/hamview/bin/hamview-collector
ENTRYPOINT ["bin/hamview-collector"]
CMD [ "executable" ]

View File

@@ -1,6 +1,8 @@
FROM alpine:3
ARG TARGETARCH
ARG TARGETVARIANT
WORKDIR /opt/hamview
COPY ../../etc /etc/hamview
COPY ../../build/hamview-receiver /opt/hamview/bin/hamview-receiver
COPY ../../build/hamview-receiver-${$TARGETARCH}${TARGETVARIANT#v} /opt/hamview/bin/hamview-receiver
ENTRYPOINT ["bin/hamview-receiver"]
CMD [ "protocol" ]