2021-12-17 22:44:42 +00:00
|
|
|
---
|
2021-12-19 11:00:51 +00:00
|
|
|
name: build-arm
|
2021-12-17 22:44:42 +00:00
|
|
|
|
|
|
|
# Trigger the workflow on push or pull request
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_job:
|
|
|
|
runs-on: ubuntu-20.04
|
2021-12-19 11:00:51 +00:00
|
|
|
name: linux_${{ matrix.arch }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: armv7
|
2023-09-05 15:05:27 +00:00
|
|
|
go: 1.20.7
|
2021-12-19 11:00:51 +00:00
|
|
|
go_arch: armv6l
|
|
|
|
- arch: aarch64
|
2023-09-05 15:05:27 +00:00
|
|
|
go: 1.20.7
|
2021-12-19 11:00:51 +00:00
|
|
|
go_arch: arm64
|
2021-12-17 22:44:42 +00:00
|
|
|
steps:
|
2022-03-07 10:28:29 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-17 22:44:42 +00:00
|
|
|
name: Checkout
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-09-05 08:38:56 +00:00
|
|
|
- uses: uraimo/run-on-arch-action@v2.5.1
|
2021-12-17 22:44:42 +00:00
|
|
|
name: Test and Build
|
|
|
|
id: runcmd
|
|
|
|
with:
|
2021-12-19 11:00:51 +00:00
|
|
|
arch: ${{ matrix.arch }}
|
2021-12-17 22:44:42 +00:00
|
|
|
distro: ubuntu20.04
|
|
|
|
githubToken: ${{ github.token }}
|
|
|
|
|
|
|
|
setup: |
|
|
|
|
mkdir -p "/tmp/artifacts"
|
|
|
|
dockerRunArgs: |
|
|
|
|
--volume "/tmp/artifacts:/artifacts"
|
|
|
|
install: |
|
|
|
|
apt update
|
|
|
|
apt install -y fuse libfuse-dev rpm pkg-config curl git make gcc g++
|
|
|
|
apt upgrade -y
|
|
|
|
run: |
|
|
|
|
export PATH=$PATH:/usr/local/go/bin
|
|
|
|
rm -rf /usr/local/go
|
|
|
|
mkdir -p /usr/local/go
|
2021-12-19 11:00:51 +00:00
|
|
|
curl -s -L https://golang.org/dl/go${{ matrix.go }}.linux-${{ matrix.go_arch }}.tar.gz | tar -C /usr/local -xz
|
2021-12-17 22:44:42 +00:00
|
|
|
go version
|
|
|
|
|
|
|
|
make test
|
|
|
|
make build
|
|
|
|
cp bin/* /artifacts
|
2021-12-19 11:00:51 +00:00
|
|
|
- name: Show artifacts
|
2021-12-17 22:44:42 +00:00
|
|
|
run: |
|
|
|
|
ls -al "/tmp/artifacts"
|
|
|
|
- name: Upload artifacts
|
2022-10-08 16:30:20 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-12-17 22:44:42 +00:00
|
|
|
with:
|
|
|
|
if-no-files-found: error
|
2021-12-19 11:00:51 +00:00
|
|
|
name: build-${{ matrix.arch }}
|
|
|
|
path: "/tmp/artifacts/*"
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
files: "/tmp/artifacts/*"
|