Files
bleh/.gitea/workflows/build.yml
Ignacio Rivero f9f4627d92
Some checks failed
Build / build (amd64, linux) (push) Failing after 49s
Build / build (arm, 7, linux) (push) Failing after 6s
Build / build (arm64, linux) (push) Failing after 6s
Add CI/CD
2026-05-05 14:10:01 -03:00

67 lines
1.7 KiB
YAML

name: Build
on:
push:
branches: [main, daemon]
tags: ['v*']
pull_request:
branches: [main, daemon]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: linux
goarch: arm
goarm: '7'
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.22'
cache: true
- name: Vet
run: go vet ./...
- name: Build
env:
CGO_ENABLED: '0'
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
GOARM: ${{ matrix.goarm }}
GOFLAGS: -trimpath -ldflags=-s -ldflags=-w
run: make build
- name: Package
run: |
arch="${{ matrix.goarch }}${{ matrix.goarm && format('v{0}', matrix.goarm) || '' }}"
name="bleh-${{ matrix.goos }}-${arch}"
stage="dist-stage/${name}"
mkdir -p "${stage}/bin" "${stage}/dist"
cp bin/bleh bin/blehd "${stage}/bin/"
cp -r dist/systemd dist/openrc dist/INSTALL.md "${stage}/dist/"
cp README.md LICENSE LICENSE.gplv3 LICENSE.mit "${stage}/"
tar -C dist-stage -czf "${name}.tar.gz" "${name}"
sha256sum "${name}.tar.gz" > "${name}.tar.gz.sha256"
echo "ARTIFACT=${name}" >> "$GITHUB_ENV"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.ARTIFACT }}
path: |
${{ env.ARTIFACT }}.tar.gz
${{ env.ARTIFACT }}.tar.gz.sha256
if-no-files-found: error