Build for armv6 (gcc 10.2) #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build for armv6 | |
on: | |
workflow_dispatch: | |
inputs: | |
connect-type: | |
required: true | |
type: choice | |
description: Board type | |
options: | |
- FULLSPEC | |
- STANDARD | |
default: FULLSPEC | |
debug-flag: | |
required: true | |
type: boolean | |
default: false | |
schedule: | |
- cron: '20 5 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: cpp | |
env: | |
PACKAGES: "protobuf-compiler" | |
ARTIFACT_REPOSITORY: ${{ secrets.ARTIFACT_REPOSITORY }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} | |
CROSS_TOOLS_ARM: ${{ secrets.CROSS_TOOLS_ARMV6 }} | |
CROSS_TOOLS_GLIBC: ${{ secrets.CROSS_TOOLS_GLIBC }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install additional packages | |
run: sudo apt install --yes ${{ env.PACKAGES }} | |
- name: Set up cross compilation environment | |
run: | | |
cd /tmp && | |
wget -q ${{ secrets.ARTIFACT_REPOSITORY }}/${{ env.CROSS_TOOLS_ARM }} && | |
wget -q ${{ secrets.ARTIFACT_REPOSITORY }}/${{ env.CROSS_TOOLS_GLIBC }} && | |
mkdir /opt/cross && | |
cd /opt/cross && | |
tar zxf /tmp/$CROSS_TOOLS_ARM && rm /tmp/$CROSS_TOOLS_ARM && | |
tar zxf /tmp/$CROSS_TOOLS_GLIBC &&rm /tmp/$CROSS_TOOLS_GLIBC && | |
ln -s /lib/x86_64-linux-gnu/libmpc.so.3 /opt/cross/glibc-2.36/lib && | |
ln -s /lib/x86_64-linux-gnu/libmpfr.so.6 /opt/cross/glibc-2.36/lib && | |
ln -s /lib/x86_64-linux-gnu/libgmp.so.10 /opt/cross/glibc-2.36/lib | |
- name: Build debug strings | |
if: ${{ inputs.debug-flag }} | |
run: echo "debug_flag_compile=DEBUG\=1" >> $GITHUB_ENV | |
- name: Compile | |
run: | | |
export LDFLAGS="-Wl,-rpath-link,/opt/cross/armv6/arm-linux-gnueabihf/sys-root/lib" && | |
make -j $(nproc) CONNECT_TYPE=${{ inputs.connect-type }} ${{ env.debug_flag_compile }} CROSS_COMPILE=/opt/cross/armv6/bin/arm-linux-gnueabihf- | |
- name: Build package | |
run: | | |
/opt/cross/armv6/bin/arm-linux-gnueabihf-strip bin/* && | |
tar czf /tmp/armv6-binaries.tar.gz bin/* && | |
scp -B -i ${{ secrets.DEPLOY_TOKEN }} -p /tmp/armv6-binaries.tar.gz ${{ secrets.DEPLOY_PATH }} |