Skip to content

Commit c5d3caf

Browse files
committed
test build arm by workflow
Signed-off-by: Frank Li <[email protected]>
1 parent c66737a commit c5d3caf

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/build_arm.yaml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build for arm ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- uuu*
9+
pull_request:
10+
types:
11+
- opened
12+
- synchronize
13+
14+
jobs:
15+
build_job:
16+
# The host should always be linux
17+
runs-on: ubuntu-latest
18+
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
19+
20+
# Run steps on a matrix of 4 arch/distro combinations
21+
strategy:
22+
matrix:
23+
include:
24+
- arch: aarch64
25+
distro: ubuntu20.04
26+
steps:
27+
- uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
31+
- uses: uraimo/run-on-arch-action@v2
32+
name: Build artifact
33+
id: build
34+
with:
35+
arch: ${{ matrix.arch }}
36+
distro: ${{ matrix.distro }}
37+
38+
# Not required, but speeds up builds
39+
githubToken: ${{ github.token }}
40+
41+
# Mount the artifacts directory as /artifacts in the container
42+
dockerRunArgs: |
43+
--volume "${PWD}:/mfgtools"
44+
45+
# Pass some environment variables to the container
46+
env: | # YAML, but pipe character is necessary
47+
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
48+
49+
# The shell to run commands with in the container
50+
shell: /bin/sh
51+
52+
# Install some dependencies in the container. This speeds up builds if
53+
# you are also using githubToken. Any dependencies installed here will
54+
# be part of the container image that gets cached, so subsequent
55+
# builds don't have to re-install them. The image layer is cached
56+
# publicly in your project's package repository, so it is vital that
57+
# no secrets are present in the container state or logs.
58+
install: |
59+
apt-get update -q -y
60+
apt-get install -q -y libusb-1.0-0-dev libbz2-dev libzstd-dev pkg-config cmake libssl-dev g++ zlib1g-dev git
61+
62+
# Produce a binary artifact and place it in the mounted volume
63+
run: |
64+
git config --global --add safe.directory /mfgtools
65+
cd /mfgtools
66+
git status
67+
cmake .
68+
make
69+
70+
- name: Rename
71+
run: cp uuu/uuu uuu_${{ matrix.arch }}
72+
73+
- name: Upload Build Artifacts
74+
uses: actions/upload-artifact@v3
75+
with:
76+
name: uuu_${{ matrix.arch }}
77+
path: uuu_${{ matrix.arch }}
78+
79+
- name: Create or Update Release
80+
uses: ncipollo/release-action@v1
81+
with:
82+
name: Release ${{ github.ref_name }}
83+
tag: ${{ github.ref_name }}
84+
commit: ${{ github.sha }}
85+
allowUpdates: true
86+
prerelease: true
87+
artifacts: "uuu_${{ matrix.arch }}"
88+

0 commit comments

Comments
 (0)