Build for armv6 (gcc 10.2) #13
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 $PACKAGES | |
- name: Set up cross compilation environment | |
run: | | |
cd /tmp && | |
wget -q $ARTIFACT_REPOSITORY/$CROSS_TOOLS_ARM && | |
wget -q $ARTIFACT_REPOSITORY/$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=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 }} $DEBUG CROSS_COMPILE=/opt/cross/armv6/bin/arm-linux-gnueabihf- | |
- name: Deploy binary package | |
run: | | |
/opt/cross/armv6/bin/arm-linux-gnueabihf-strip bin/* && | |
mv bin .. && cd .. && | |
tar zcf /tmp/armv6-binaries.tar.gz bin doc && | |
echo $DEPLOY_TOKEN >> key && | |
scp -B -q -i key -p /tmp/armv6-binaries.tar.gz $DEPLOY_PATH |