-
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.
feat: Use custom container for package builds
This creates a container image with dependencies already installed. It is published to ghcr.io/t2linux/fedora-kernel-build. Merges #9
- Loading branch information
1 parent
1d448b2
commit 875c7e7
Showing
5 changed files
with
58 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Create build container | ||
on: | ||
push: | ||
paths: | ||
- Containerfile | ||
|
||
jobs: | ||
build-container: | ||
name: Build container image | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_NAME: fedora-kernel-build | ||
REGISTRY: ghcr.io | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build container image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.IMAGE_NAME }} | ||
tags: latest ${{ github.sha }} 38 | ||
containerfiles: | | ||
./Containerfile | ||
- name: Log in to ghcr.io | ||
if: github.ref == 'refs/heads/main' | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: t2linux | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Push to ghcr.io | ||
if: github.ref == 'refs/heads/main' | ||
id: push-to-ghcr | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: ${{ env.REGISTRY }} |
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
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM fedora:38 | ||
SHELL ["/usr/bin/env", "bash", "-c"] | ||
RUN dnf install -y koji git rpmdevtools rpm-sign mock ccache zstd && \ | ||
dnf clean all && \ | ||
echo "\ | ||
config_opts['plugin_conf']['package_state_enable'] = False \n\ | ||
config_opts['macros']['_smp_mflags'] = '-j8' \n\ | ||
config_opts['plugin_conf']['ccache_opts']['compress'] = True \n\ | ||
config_opts['plugin_conf']['root_cache_opts']['compress_program'] = 'zstd' \n\ | ||
config_opts['plugin_conf']['root_cache_opts']['extension'] = '.zst' \n\ | ||
config_opts['plugin_conf']['hw_info_enable'] = False\n" > /etc/mock/site-defaults.cfg | ||
WORKDIR /repo |
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#!/usr/bin/bash | ||
source /repo/util.sh | ||
dnf install --quiet -y rpm-sign rpmdevtools | ||
|
||
cd /repo/_output | ||
sign_packages $RPM_SIGNING_PRIVATE_KEY_B64 "T2Linux Fedora" |