81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
name: Test and build
|
|
on:
|
|
push:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
check-latest: false
|
|
#- name: golangci-lint
|
|
# uses: golangci/golangci-lint-action@v9
|
|
# with:
|
|
# go-version: ${{ matrix.go }}
|
|
# version: v2.6
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
goarm: ""
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: "6"
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: "7"
|
|
steps:
|
|
- name: Debug env
|
|
run: env | sort
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
check-latest: false
|
|
- 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: Setup git to use token debug
|
|
run: echo git config --global url."https://${GITHUB_ACTOR}:${{ secrets.GITEA_TOKEN }}@git.maze.io/".insteadOf "https://git.maze.io/"
|
|
- name: Setup git to use token
|
|
run: git config --global url."https://${GITHUB_ACTOR}:${{ secrets.GITEA_TOKEN }}@git.maze.io/".insteadOf "https://git.maze.io/"
|
|
- name: Download modules
|
|
run: go mod download
|
|
- name: Make build directory
|
|
run: mkdir -p build && readlink -f build
|
|
- name: Build
|
|
run: go build -o build/hamview-receiver.${{ matrix.goarch }}${{ matrix.goarm }} . && readlink -f build/hamview-receiver.${{ matrix.goarch }}${{ matrix.goarm }}
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Log into Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY }}
|
|
username: ${{ vars.DEPLOY_USER }}
|
|
password: ${{ secrets.DEPLOY_TOKEN }}
|
|
- name: Build and push receiver container
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
push: true
|
|
tags: ham/hamview-receiver:latest
|
|
context: .
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm/v6
|
|
linux/arm/v7
|