Skip to content

Commit 167bc18

Browse files
committed
feat: release x86_64 alpine hosted cross toolchains
distribute cross chains for alpine hosts as it seems they don't exist yet. Thanks to David Sugar for his feedback about it: Alpine can be made to produce static binaries, but it's cross-compile support never was formally extended to arbitrary user space outside of bootstrap. So, if I want to build arbitrary user mode applications for Arm, I could locally do a arm build on a pi or on qemu user mode, but both are tortuously slow. I saw this as potentially filling a particular gap. In this case, knowing what gap to fill was already half of the job :^)
1 parent ec579dc commit 167bc18

File tree

1 file changed

+62
-3
lines changed

1 file changed

+62
-3
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
# build/release-intro.md
4242

4343
linux-release:
44-
name: Build
44+
name: 🐧 Ubuntu build
4545
runs-on: ubuntu-latest
4646
needs: [semantic-release]
4747
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
@@ -76,6 +76,7 @@ jobs:
7676
run: |
7777
make -s -j`nproc`
7878
make -s install
79+
cat README.md | awk '{gsub(/\[[^][]+\]\([^()]+\)/, gensub(/\[([^][]+)\]\([^()]+\)/, "\\1", "g")); print}' | fmt -w 72 > /opt/musl-dyne/README.txt
7980
echo "Compressing: musl-dyne-${{ matrix.output }}.tar.xz"
8081
cd /opt && tar -cJf musl-dyne-${{ matrix.output }}.tar.xz musl-dyne
8182
- name: Upload release artifacts musl-dyne-${{ matrix.output }}
@@ -85,9 +86,63 @@ jobs:
8586
path: |
8687
/opt/musl-dyne-${{ matrix.output }}.tar.xz
8788
89+
alpine-release:
90+
name: 🗻 Alpine build
91+
runs-on: ubuntu-latest
92+
needs: [semantic-release]
93+
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
94+
strategy:
95+
matrix:
96+
include:
97+
- target: arm-linux-musleabihf
98+
output: arm_hf
99+
- target: riscv64-linux-musl
100+
output: riscv_64
101+
- target: aarch64-linux-musl
102+
output: arm_64
103+
steps:
104+
- uses: actions/checkout@v4
105+
- name: Setup latest Alpine Linux
106+
uses: jirutka/setup-alpine@v1
107+
with:
108+
volumes: /opt
109+
packages: >-
110+
bash
111+
make
112+
gcc
113+
build-base
114+
curl
115+
patch
116+
gawk
117+
ccache
118+
perl
119+
rsync
120+
xz
121+
- name: Download sources inside Alpine chroot
122+
run: |
123+
ls -la
124+
cd sources && sh download_from_dyne.sh
125+
shell: alpine.sh {0}
126+
- name: Build musl-dyne inside Alpine chroot
127+
env:
128+
XZ_OPT: -9e -T0
129+
TARGET: ${{ matrix.target }}
130+
shell: alpine.sh --root {0}
131+
run: |
132+
make -j`nproc`
133+
make install
134+
echo "Compressing: cross-alpine-${{ matrix.output }}.tar.xz"
135+
cd /opt && tar -cJf cross-alpine-${{ matrix.output }}.tar.xz musl-dyne
136+
- name: Upload release artifacts cross-alpine-${{ matrix.output }}
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: alpine-${{ matrix.output }}
140+
path: |
141+
/opt/cross-alpine-${{ matrix.output }}.tar.xz
142+
88143
draft-binary-release:
89144
name: 📦 Pack release
90-
needs: [semantic-release, linux-release]
145+
needs: [semantic-release, linux-release, alpine-release]
91146
runs-on: ubuntu-latest
92147
steps:
93148
- name: download binary artifacts
@@ -115,6 +170,9 @@ jobs:
115170
musl-dyne/release-arm_hf/musl-dyne-arm_hf.tar.xz,
116171
musl-dyne/release-arm_64/musl-dyne-arm_64.tar.xz,
117172
musl-dyne/release-riscv_64/musl-dyne-riscv_64.tar.xz,
173+
musl-dyne/alpine-arm_hf/cross-alpine-arm_hf.tar.xz,
174+
musl-dyne/alpine-arm_64/cross-alpine-arm_64.tar.xz,
175+
musl-dyne/alpine-riscv_64/cross-alpine-riscv_64.tar.xz,
118176
musl-dyne/checksums/SHA256SUMS.txt
119177
target: |
120178
/srv/ftp/musl
@@ -125,6 +183,7 @@ jobs:
125183
with:
126184
files: |
127185
musl-dyne/release-*/*
186+
musl-dyne/alpine-*/*
128187
musl-dyne/checksums/SHA256SUMS.txt
129188
tag_name: ${{ needs.semantic-release.outputs.new_release_version }}
130189
#body_path: musl-dyne/documentation/release-intro.md
@@ -136,7 +195,7 @@ jobs:
136195

137196
remove-tag-on-fail:
138197
name: 🧻 Remove tag on fail
139-
needs: [semantic-release, linux-release]
198+
needs: [semantic-release, linux-release, alpine-release]
140199
runs-on: ubuntu-latest
141200
if: ${{ (failure() || cancelled()) && needs.semantic-release.outputs.new_release_published == 'True' }}
142201
steps:

0 commit comments

Comments
 (0)