diff --git a/.github/workflows/actions/build-composite.yml b/.github/workflows/actions/build-composite.yml index fba9af5..1443939 100644 --- a/.github/workflows/actions/build-composite.yml +++ b/.github/workflows/actions/build-composite.yml @@ -36,6 +36,13 @@ inputs: 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" + 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. + This feature is useful for testing new features, but should not be used in production. + Input must match the string 'true' for the unstable version to be used. + required: false + default: "false" cli_version: description: | Set this with a tag, sha, or branch name for the blue-build/cli repo to use that particular version of the CLI tool. This will override the `use_unstable_cli` input for the action. @@ -44,7 +51,7 @@ inputs: description: | The container registry to push the built image to. required: false - default: "git.hydrosaber.com" + default: "ghcr.io" registry_namespace: description: | The namespace on the registry to push to. @@ -52,6 +59,15 @@ inputs: Example: `ublue-os` required: false default: ${{ github.repository_owner }} + rechunk: + description: | + Rechunk the ostree-based result images with [github.com/hhd-dev/rechunk](https://github.com/hhd-dev/rechunk) for more efficient diffs and updates. (lower image size, better download speed, better update resuming) + + Will make your builds considerably slower. This is an experimental option, as it can cause issues with file permissions in some scenarios, so enable on your own risk. + + Internally builds squashed images with podman to further reduce the image size. + required: false + default: "false" use_cache: description: | Make use of layer cache by pushing the layers to the registry. Input must match the string 'true' for the step to be enabled. @@ -99,6 +115,14 @@ runs: uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 if: ${{ inputs.maximize_build_space == 'true' }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@18ce135bb5112fa8ce4ed6c17ab05699d7f3a5e0 # v3.11.0 + if: ${{ inputs.squash != 'true' && inputs.rechunk != 'true' }} + with: + install: true + driver: docker-container + cache-binary: ${{ inputs.use_cache }} + - name: Get Ubuntu version id: ubuntu_version shell: bash @@ -109,6 +133,7 @@ runs: # that is compatible with BlueBuild - name: Setup Podman + if: ${{ (inputs.squash == 'true' || inputs.rechunk == 'true') && steps.ubuntu_version.outputs.version == '22.04' }} shell: bash run: | # from https://askubuntu.com/questions/1414446/whats-the-recommended-way-of-installing-podman-4-in-ubuntu-22-04 @@ -135,7 +160,9 @@ runs: env: RECIPE: ${{ inputs.recipe }} run: | - if [ -n "${{ inputs.cli_version }}" ]; then + if [[ "${{ inputs.use_unstable_cli }}" == "true" && -z "${{ inputs.cli_version }}" ]]; then + CLI_VERSION_TAG="main" + elif [ -n "${{ inputs.cli_version }}" ]; then CLI_VERSION_TAG="${{ inputs.cli_version }}" else CLI_VERSION_TAG="v0.9" @@ -180,4 +207,18 @@ runs: CLICOLOR_FORCE: "1" BUILD_OPTS: ${{ inputs.build_opts }} run: | - sudo -E bluebuild build -v --push --rechunk ${BUILD_OPTS} ${RECIPE_PATH} \ No newline at end of file + if [ "${{ inputs.squash }}" = "true" ]; then + BUILD_OPTS="--build-driver podman --squash $BUILD_OPTS" + fi + + RUN_SUDO="" + if [ "${{ inputs.rechunk }}" = "true" ]; then + RUN_SUDO=1 + BUILD_OPTS="--rechunk $BUILD_OPTS" + fi + + if [ -n "$RUN_SUDO" ]; then + sudo -E bluebuild build -v --push ${BUILD_OPTS} ${RECIPE_PATH} + else + bluebuild build -v --push ${BUILD_OPTS} ${RECIPE_PATH} + fi \ No newline at end of file