Build workflow #9
Workflow file for this run
This file contains hidden or 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 workflow | |
run-name: Build workflow | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- 'master' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64 | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4 | |
- name: Run in ARM64 container | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: debian:bookworm | |
options: --platform=linux/arm64 -v ${{ github.workspace }}:/workspace | |
run: | | |
cd /workspace | |
apt-get update | |
apt-get -y dist-upgrade | |
apt-get -y install locales build-essential gettext libpq5 libpq-dev make gcc git openssh-client curl wget sudo lsb-release socat redis-server cmake | |
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen | |
locale-gen | |
# Verify we're running on ARM64 | |
echo "Architecture: $(uname -m)" | |
if [[ ! "${{ github.ref_name }}" =~ perl-[0-9]+\.[0-9]+\.[0-9]+ ]]; then | |
echo "Error: Branch name must be perl-<version>" | |
exit 1 | |
fi | |
VERSION=$(echo ${{ github.ref_name }} | sed -e 's/.*perl-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/') | |
echo "VERSION=$VERSION" | |
git config --global user.email "[email protected]" | |
git config --global user.name "ci bot" | |
git config --global --add safe.directory /workspace | |
# Update rebuild.sh for arm64 | |
sed -i 's/x86_64-linux/aarch64-linux/g' rebuild.sh | |
sed -i "s|-Dprefix=/home/git/binary-com/perl|-Dprefix=/workspace|g" rebuild.sh | |
# Compile | |
bash ./rebuild.sh | |
# Push changes | |
rm -rf lib bin man | |
cp -r /workspace/{bin,lib} . | |
git add lib bin | |
git commit -m "[ci skip] compile $VERSION" | |
git push origin HEAD:${{ github.ref_name }} |