|
|
|
@ -16,9 +16,34 @@ permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
|
|
# build components using a job matrix, so they can run in parallel
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
# compile buildah v1.38.0, so we can have a more up-to-date version than ubuntu 24.04 has in its repos
|
|
|
|
|
buildah:
|
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
|
steps:
|
|
|
|
|
- name: Install buildah dependencies
|
|
|
|
|
run: |
|
|
|
|
|
sudo apt update
|
|
|
|
|
sudo apt install -y bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make runc skopeo libbtrfs-dev
|
|
|
|
|
- name: Pull buildah sources
|
|
|
|
|
run: |
|
|
|
|
|
git clone https://github.com/containers/buildah
|
|
|
|
|
cd buildah
|
|
|
|
|
git checkout v1.38.0
|
|
|
|
|
- name: Build buildah
|
|
|
|
|
run: |
|
|
|
|
|
cd buildah
|
|
|
|
|
make
|
|
|
|
|
sudo make install
|
|
|
|
|
- name: Save buildah build artifact
|
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
name: buildah-bin
|
|
|
|
|
path: /usr/local/bin/buildah
|
|
|
|
|
# build components using a job matrix, so they can run in parallel
|
|
|
|
|
build:
|
|
|
|
|
needs: buildah
|
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
@ -40,8 +65,22 @@ jobs:
|
|
|
|
|
- thrimshim
|
|
|
|
|
- zulip_bots
|
|
|
|
|
steps:
|
|
|
|
|
- name: Fetch buildah build artifact
|
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
|
with:
|
|
|
|
|
name: buildah-bin
|
|
|
|
|
path: /usr/local/bin/buildah
|
|
|
|
|
- name: Ensure buildah binary has +x permissions set
|
|
|
|
|
run: |
|
|
|
|
|
sudo chmod +x /usr/local/bin/buildah
|
|
|
|
|
- name: Check buildah version
|
|
|
|
|
run: |
|
|
|
|
|
ls -l /usr/local/bin/buildah
|
|
|
|
|
echo $PATH
|
|
|
|
|
which buildah
|
|
|
|
|
buildah version
|
|
|
|
|
- name: Check out repo
|
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
with:
|
|
|
|
|
submodules: recursive
|
|
|
|
|
# By default, for PR builds, Actions will check out a merge commit between the actual
|
|
|
|
@ -51,8 +90,14 @@ jobs:
|
|
|
|
|
# This option makes it actually check out the PR's commit instead.
|
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
|
|
|
|
|
|
- name: Log into ghcr.io
|
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
|
- name: Install QEMU
|
|
|
|
|
# qemu-user-static is used by buildah to do multiplatform builds
|
|
|
|
|
run: |
|
|
|
|
|
sudo apt update
|
|
|
|
|
sudo apt install -y qemu-user-static
|
|
|
|
|
|
|
|
|
|
- name: Log in to ghcr.io
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
|
|
|
|
registry: ghcr.io
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
@ -62,8 +107,9 @@ jobs:
|
|
|
|
|
# always push
|
|
|
|
|
# if not a pull request and a push to master, also push "latest" tag
|
|
|
|
|
# try to cache from previous build and then build component using build script
|
|
|
|
|
# set the multiarch flag so we also build arm64 images and not just amd64
|
|
|
|
|
run: |
|
|
|
|
|
export PUSH=true CACHE=true
|
|
|
|
|
export PUSH=true CACHE=true MULTIPLATFORM=true
|
|
|
|
|
# Only push latest when pushing to master
|
|
|
|
|
if [ "$GITHUB_EVENT_NAME" != "pull_request" ] && [ "$GITHUB_REF" == "refs/heads/master" ]; then export PUSH=latest; fi
|
|
|
|
|
# PRs from forked repositories can't have package write permissions, so use cache in readonly mode in those cases.
|
|
|
|
|