Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cab4326

Browse files
set VERSION=5.26.2
1 parent 95dd78e commit cab4326

File tree

1 file changed

+41
-44
lines changed

1 file changed

+41
-44
lines changed

.github/workflows/build_workflow.yml

Lines changed: 41 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ concurrency:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14-
container:
15-
image: debian:bookworm
16-
options: --platform=linux/arm64
17-
defaults:
18-
run:
19-
shell: bash -le {0}
20-
env:
21-
BRANCH: ${{ github.ref_name }}
2214
steps:
2315
- name: Set up QEMU
2416
uses: docker/setup-qemu-action@v3
@@ -28,39 +20,44 @@ jobs:
2820
- name: Checkout
2921
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4
3022

31-
- name: Prepare environment
32-
run: |
33-
apt-get update
34-
apt-get -y dist-upgrade
35-
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
36-
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
37-
locale-gen
38-
39-
if [[ ! "$BRANCH" =~ perl-[0-9]+\.[0-9]+\.[0-9]+ ]]; then
40-
echo "Error: Branch name must be perl-<version>"
41-
exit 1
42-
fi
43-
44-
VERSION=$(echo $BRANCH | sed -e 's/.*perl-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
45-
echo "VERSION=$VERSION" | tee -a $GITHUB_ENV
46-
47-
git config --global user.email "[email protected]"
48-
git config --global user.name "ci bot"
49-
git config --global --add safe.directory $GITHUB_WORKSPACE
50-
51-
- name: Update rebuild.sh for arm64
52-
run: |
53-
sed -i 's/x86_64-linux/aarch64-linux/g' rebuild.sh
54-
sed -i "s|-Dprefix=/home/git/binary-com/perl|-Dprefix=$GITHUB_WORKSPACE|g" rebuild.sh
55-
56-
- name: Compile
57-
run: |
58-
bash ./rebuild.sh
59-
60-
- name: Push changes
61-
run: |
62-
rm -rf lib bin man
63-
cp -r $GITHUB_WORKSPACE/{bin,lib} .
64-
git add lib bin
65-
git commit -m "[ci skip] compile $VERSION"
66-
git push origin HEAD:$BRANCH
23+
- name: Run in ARM64 container
24+
uses: addnab/docker-run-action@v3
25+
with:
26+
image: debian:bookworm
27+
options: --platform=linux/arm64 -v ${{ github.workspace }}:/workspace
28+
run: |
29+
cd /workspace
30+
apt-get update
31+
apt-get -y dist-upgrade
32+
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
33+
echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen
34+
locale-gen
35+
36+
# Verify we're running on ARM64
37+
echo "Architecture: $(uname -m)"
38+
39+
if [[ ! "${{ github.ref_name }}" =~ perl-[0-9]+\.[0-9]+\.[0-9]+ ]]; then
40+
echo "Error: Branch name must be perl-<version>"
41+
exit 1
42+
fi
43+
44+
VERSION=$(echo ${{ github.ref_name }} | sed -e 's/.*perl-\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
45+
echo "VERSION=$VERSION"
46+
47+
git config --global user.email "[email protected]"
48+
git config --global user.name "ci bot"
49+
git config --global --add safe.directory /workspace
50+
51+
# Update rebuild.sh for arm64
52+
sed -i 's/x86_64-linux/aarch64-linux/g' rebuild.sh
53+
sed -i "s|-Dprefix=/home/git/binary-com/perl|-Dprefix=/workspace|g" rebuild.sh
54+
55+
# Compile
56+
bash ./rebuild.sh
57+
58+
# Push changes
59+
rm -rf lib bin man
60+
cp -r /workspace/{bin,lib} .
61+
git add lib bin
62+
git commit -m "[ci skip] compile $VERSION"
63+
git push origin HEAD:${{ github.ref_name }}

0 commit comments

Comments
 (0)