-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from prydom/switch-to-podman
Switch to the podman drivers for the bluebuild build
- Loading branch information
Showing
2 changed files
with
10 additions
and
56 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ inputs: | |
Whether to run the unwanted software remover to maximize build space in the GitHub builder. | ||
Disable this with 'false' if your image doesn't take up a lot of space and you'd rather have shorter build times. | ||
required: false | ||
default: 'true' | ||
default: 'false' | ||
use_unstable_cli: | ||
description: | | ||
If true, this action pulls the `main` branch of blue-build/cli instead of the stable version the current action version is configured to use by default. | ||
|
@@ -59,19 +59,6 @@ inputs: | |
Example: `ublue-os` | ||
required: false | ||
default: ${{ github.repository_owner }} | ||
use_cache: | ||
description: | | ||
Make use of docker buildx cache. This is an experimental feature of docker buildx | ||
so it isn't guaranteed to work. | ||
Input must match the string 'true' for the step to be enabled. | ||
required: false | ||
default: 'true' | ||
squash: | ||
description: | | ||
Uses buildah to squash the build's layers into a single layer. Use of this option | ||
disables cache. | ||
required: false | ||
default: 'false' | ||
working_directory: | ||
description: | | ||
Changes working directory for whole build. | ||
|
@@ -83,34 +70,11 @@ runs: | |
using: "composite" | ||
steps: | ||
# building custom images might take a lot of space, | ||
# so it's best to remove unneeded softawre | ||
# so it's best to remove unneeded software | ||
- name: Maximize build space | ||
uses: jlumbroso/[email protected] | ||
if: ${{ inputs.maximize_build_space == 'true' }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
if: ${{ inputs.squash != 'true' }} | ||
with: | ||
install: true | ||
driver: docker-container | ||
cache-binary: ${{ inputs.use_cache }} | ||
|
||
# Installs the latest version of Podman | ||
# that is compatible with BlueBuild | ||
- name: Setup Podman | ||
if: ${{ inputs.squash == 'true' }} | ||
shell: bash | ||
run: | | ||
# from https://askubuntu.com/questions/1414446/whats-the-recommended-way-of-installing-podman-4-in-ubuntu-22-04 | ||
ubuntu_version='22.04' | ||
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | ||
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}" | ||
echo "deb $sources_url/ /" | sudo tee /etc/apt/sources.list.d/devel-kubic-libcontainers-unstable.list | ||
curl -fsSL $key_url | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null | ||
sudo apt-get update | ||
sudo apt-get install -y podman | ||
- uses: sigstore/[email protected] | ||
|
||
# clones user's repo | ||
|
@@ -144,20 +108,13 @@ runs: | |
env: | ||
CLI_VERSION_TAG: ${{ steps.build_vars.outputs.cli_version }} | ||
run: | | ||
docker create \ | ||
podman create \ | ||
--name blue-build-installer \ | ||
ghcr.io/blue-build/cli${{ env.CLI_VERSION_TAG }} | ||
docker cp blue-build-installer:/out/bluebuild /usr/local/bin/bluebuild | ||
docker rm blue-build-installer | ||
podman cp blue-build-installer:/out/bluebuild /usr/local/bin/bluebuild | ||
podman rm blue-build-installer | ||
bluebuild --version | ||
# Required in order for docker buildx to | ||
# take advantage of the GHA cache API | ||
- name: Expose GitHub Runtime | ||
if: ${{ inputs.use_cache == 'true' && inputs.squash != 'true' }} | ||
uses: crazy-max/ghaction-github-runtime@v3 | ||
|
||
|
||
# blue-build/cli does the heavy lifting | ||
- name: Build Image | ||
shell: bash | ||
|
@@ -170,15 +127,9 @@ runs: | |
BB_REGISTRY: ${{ inputs.registry }} | ||
BB_REGISTRY_NAMESPACE: ${{ inputs.registry_namespace }} | ||
GH_PR_EVENT_NUMBER: ${{ inputs.pr_event_number }} | ||
BB_BUILDKIT_CACHE_GHA: ${{ inputs.use_cache }} | ||
RECIPE_PATH: ${{ steps.build_vars.outputs.recipe_path }} | ||
RUST_LOG_STYLE: always | ||
CLICOLOR_FORCE: '1' | ||
run: | | ||
BUILD_OPTS="--compression-format gzip" | ||
if [ "${{ inputs.squash }}" = "true" ]; then | ||
BUILD_OPTS="--build-driver podman --squash $BUILD_OPTS" | ||
fi | ||
BUILD_OPTS="--compression-format gzip --build-driver podman --run-driver podman" | ||
bluebuild build -v --push ${BUILD_OPTS} ${RECIPE_PATH} |
This file contains 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