Build for armv8 (gcc 12.2) #37
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 armv8 | |
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: '50 5 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: cpp | |
env: | |
ARTIFACT_REPOSITORY: ${{ secrets.ARTIFACT_REPOSITORY }} | |
CROSS_TOOLS_ARM: ${{ secrets.CROSS_TOOLS_ARMV8 }} | |
CROSS_TOOLS_GLIBC: ${{ secrets.CROSS_TOOLS_GLIBC }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up cross compilation environment | |
run: | | |
cd /tmp && | |
wget -q $ARTIFACT_REPOSITORY/$CROSS_TOOLS_ARM && | |
wget -q $ARTIFACT_REPOSITORY/$CROSS_TOOLS_GLIBC && | |
wget -q $ARTIFACT_REPOSITORY/generated-bookworm.tar.gz && | |
tar zxf generated-bookworm.tar.gz && | |
mkdir $HOME/work/scsi2pi/scsi2pi/cpp/generated && | |
cp generated-bookworm/* $HOME/work/scsi2pi/scsi2pi/cpp/generated && | |
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=DEBUG\=1" >> $GITHUB_ENV | |
- name: Compile | |
run: | | |
export LDFLAGS="-Wl,-rpath-link,/opt/cross/armv8/aarch64-linux-gnu/sys-root/lib" && | |
make -j $(nproc) CONNECT_TYPE=${{ inputs.connect-type }} $DEBUG CROSS_COMPILE=/opt/cross/armv8/bin/aarch64-linux-gnu- | |
- name: Create binary package | |
run: | | |
/opt/cross/armv8/bin/aarch64-linux-gnu-strip bin/* && | |
mv bin .. && cd .. && | |
tar zcf /tmp/armv8-binaries.tar.gz bin doc | |
- name: Deploy binary package | |
uses: appleboy/scp-action@v0.1.4 | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: ${{ secrets.DEPLOY_USERNAME }} | |
key: ${{ secrets.DEPLOY_TOKEN }} | |
source: /tmp/armv6-binaries.tar.gz | |
target: ${{ secrets.DEPLOY_PATH }} |