Skip to content

Commit

Permalink
Update zlib-ng-crossbuild.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
userdocs committed Oct 5, 2024
1 parent b102346 commit c547d83
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/zlib-ng-crossbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
matrix:
name: [zlib-ng]
os_id: [debian, ubuntu]
os_codename: [bullseye, bookworm, focal, jammy, mantic]
os_codename: [bullseye, bookworm, focal, jammy, noble]
arch: [amd64, armhf, arm64]
zlib_compat: ["", "-D ZLIB_COMPAT=ON"]
include:
Expand All @@ -49,7 +49,7 @@ jobs:
- os_id: debian
os_codename: jammy
- os_id: debian
os_codename: mantic
os_codename: noble
- os_id: ubuntu
os_codename: bullseye
- os_id: ubuntu
Expand Down Expand Up @@ -77,6 +77,23 @@ jobs:
- name: Host - upgrade
run: sudo apt-get -y upgrade

# No action or other method to bootstrap binfmt-support and qemu-user-static on the host runner
- name: Host - set up qemu-user-static binfmt-support
run: sudo apt install libpipeline1 qemu-user-static binfmt-support

# Why are we doing it like this and not using a container setup? That's how you're supposed to do it, right?
# qemu-user-static and binfmt-support are not part of the runner images https://github.com/actions/runner-images?tab=readme-ov-file#available-images
# We would need to modify the runner to install these before the container starts. Which you cannot do as there is no way to bootstrap the host.
# So we install them on the host then create/pull a custom docker image that we use to build the multiarch targets.
# We are always on the host runner but can use any docker image we need with the access the qemu emulation when required.
#
# We are using these pre configured toolchain images that allows me to remove 50% of the code/time from this action.
#
# https://github.com/userdocs/dcb/blob/main/Dockerfile
#
# The image does not run as root and has password-less sudo. There are two users username:1000 /home/username and github:1001 /home/github
# In the action it runs as 1001 /home/github and files should be available to the host. For local use, you might need -u 1000

- name: Host - Create docker multiarch ${{ matrix.arch }} container
run: docker run --name multiarch -it -d -u 1001 -v ${{ github.workspace }}:/home/github ghcr.io/userdocs/dcb:${{ matrix.os_id }}-${{ matrix.os_codename }}-${{ matrix.arch }}

Expand Down Expand Up @@ -192,7 +209,7 @@ jobs:
replacesArtifacts: true
tag: "${{ env.zlib_ng_version }}"
name: "${{ matrix.name }} ${{ env.zlib_ng_version }}"
body: "${{ matrix.name }} built from github master on amd64 arm64 armhf for Debian Bullseye Bookworm and Ubuntu Focal Jammy Mantic"
body: "${{ matrix.name }} built from github master on amd64 arm64 armhf for Debian Bullseye Bookworm and Ubuntu Focal Jammy Noble"
allowUpdates: true

rerun-on-failure:
Expand Down

0 comments on commit c547d83

Please sign in to comment.