Skip to content

Commit 8925b6c

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

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+
27+
steps:
28+
- uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 0
31+
32+
- uses: uraimo/run-on-arch-action@v2
33+
name: Build artifact
34+
id: build
35+
with:
36+
arch: ${{ matrix.arch }}
37+
distro: ${{ matrix.distro }}
38+
39+
# Not required, but speeds up builds
40+
githubToken: ${{ github.token }}
41+
42+
# Mount the artifacts directory as /artifacts in the container
43+
dockerRunArgs: |
44+
--volume "${PWD}:/mfgtools"
45+
46+
# Pass some environment variables to the container
47+
env: | # YAML, but pipe character is necessary
48+
artifact_name: git-${{ matrix.distro }}_${{ matrix.arch }}
49+
50+
# The shell to run commands with in the container
51+
shell: /bin/sh
52+
53+
# Install some dependencies in the container. This speeds up builds if
54+
# you are also using githubToken. Any dependencies installed here will
55+
# be part of the container image that gets cached, so subsequent
56+
# builds don't have to re-install them. The image layer is cached
57+
# publicly in your project's package repository, so it is vital that
58+
# no secrets are present in the container state or logs.
59+
install: |
60+
apt-get update -q -y
61+
apt-get install -q -y libusb-1.0-0-dev libbz2-dev libzstd-dev pkg-config cmake libssl-dev g++ zlib1g-dev git
62+
63+
# Produce a binary artifact and place it in the mounted volume
64+
run: |
65+
git config --global --add safe.directory /mfgtools
66+
cd /mfgtools
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)