tstor/.github/workflows/build-arm.yaml

73 lines
1.9 KiB
YAML
Raw Normal View History

2021-12-17 22:44:42 +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
name: linux_${{ matrix.arch }}
strategy:
matrix:
include:
- arch: armv7
go: 1.17.5
go_arch: armv6l
- arch: aarch64
go: 1.17.5
go_arch: arm64
2021-12-17 22:44:42 +00:00
steps:
- uses: actions/checkout@v2
name: Checkout
with:
fetch-depth: 0
- uses: uraimo/run-on-arch-action@v2.1.1
name: Test and Build
id: runcmd
with:
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
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
- name: Show artifacts
2021-12-17 22:44:42 +00:00
run: |
ls -al "/tmp/artifacts"
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
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/*"