From 2b40d4b4367c669f1e557194db7bc14ac40f8b53 Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:02:22 +0300 Subject: [PATCH 1/6] feat: declare image name in recipe.yml --- .github/workflows/build.yml | 8 +++++--- recipe.yml | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e264e5..b37317f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,6 @@ on: workflow_dispatch: env: - IMAGE_NAME: startingpoint IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} jobs: @@ -41,9 +40,12 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v3 - - name: Matrix Variables + - name: Add yq - portable yaml processor + uses: mikefarah/yq@v4.33.2 + + - name: Gather image data from recipe run: | - echo "IMAGE_NAME=${{ env.IMAGE_NAME }}" >> $GITHUB_ENV + echo "IMAGE_NAME=$(yq '.name' ./recipe.yml)" >> $GITHUB_ENV - name: Generate tags id: generate-tags diff --git a/recipe.yml b/recipe.yml index 02f49df..07c74e4 100644 --- a/recipe.yml +++ b/recipe.yml @@ -1,3 +1,4 @@ +name: startingpoint rpms: - python3-pip # needed for yafti flatpaks: From f6ec397d501d67063d64b85ddbe162123131f773 Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:06:54 +0300 Subject: [PATCH 2/6] chore: merge yq and image data step --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b37317f..b5f6c90 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,10 +40,8 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v3 - - name: Add yq - portable yaml processor - uses: mikefarah/yq@v4.33.2 - - name: Gather image data from recipe + uses: mikefarah/yq@v4.33.2 run: | echo "IMAGE_NAME=$(yq '.name' ./recipe.yml)" >> $GITHUB_ENV From 5947af45da9ea324ab8c52e09142c916791d88e2 Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:08:26 +0300 Subject: [PATCH 3/6] fix: revert previous commit --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5f6c90..fc014e8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,8 +40,10 @@ jobs: - name: Checkout Push to Registry action uses: actions/checkout@v3 - - name: Gather image data from recipe + - name: Add yq for reading recipe.yml uses: mikefarah/yq@v4.33.2 + + - name: Gather image data from recipe run: | echo "IMAGE_NAME=$(yq '.name' ./recipe.yml)" >> $GITHUB_ENV From fe16187a92400865b4f96e82ce4d6781478bdfe6 Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:17:16 +0300 Subject: [PATCH 4/6] feat: declare base image and fedora ver in recipe --- .github/workflows/build.yml | 5 ++++- Containerfile | 4 ++-- recipe.yml | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc014e8..1191c67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,8 @@ jobs: - name: Gather image data from recipe run: | echo "IMAGE_NAME=$(yq '.name' ./recipe.yml)" >> $GITHUB_ENV + echo "FEDORA_MAJOR_VERSION=$(yq '.fedora-version' ./recipe.yml)" >> $GITHUB_ENV + echo "BASE_CONTAINER_URL=$(yq '.base-container' ./recipe.yml)" >> $GITHUB_ENV - name: Generate tags id: generate-tags @@ -113,7 +115,8 @@ jobs: tags: | ${{ steps.generate-tags.outputs.alias_tags }} build-args: | - FEDORA_MAJOR_VERSION=${{ matrix.major_version }} + FEDORA_MAJOR_VERSION=${{ env.FEDORA_MAJOR_VERSION }} + BASE_CONTAINER_URL=${{ env.BASE_CONTAINER_URL }} labels: ${{ steps.meta.outputs.labels }} oci: false diff --git a/Containerfile b/Containerfile index 6245b2b..34be3fd 100644 --- a/Containerfile +++ b/Containerfile @@ -1,7 +1,7 @@ ARG FEDORA_MAJOR_VERSION=37 +ARG BASE_CONTAINER_URL=ghcr.io/ublue-os/silverblue-main -# change this line if you want to change the image -FROM ghcr.io/ublue-os/silverblue-main:${FEDORA_MAJOR_VERSION} +FROM ${BASE_CONTAINER_URL}:${FEDORA_MAJOR_VERSION} # copy over configuration files COPY etc /etc diff --git a/recipe.yml b/recipe.yml index 07c74e4..ee213c8 100644 --- a/recipe.yml +++ b/recipe.yml @@ -1,4 +1,13 @@ +# the image will be at ghcr.io/yourusername/name name: startingpoint + +# what native container image to build on top of +# images not built by ublue might function unexpectly +base-container: ghcr.io/ublue-os/silverblue-main + +# what fedora version to use, you can just change this to update +fedora-version: 37 + rpms: - python3-pip # needed for yafti flatpaks: From f9ed74f2e710bb68b60f0a8cf47358c381720cc5 Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:20:47 +0300 Subject: [PATCH 5/6] docs: document everything undocumented --- recipe.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipe.yml b/recipe.yml index ee213c8..ae3e8dd 100644 --- a/recipe.yml +++ b/recipe.yml @@ -8,8 +8,14 @@ base-container: ghcr.io/ublue-os/silverblue-main # what fedora version to use, you can just change this to update fedora-version: 37 +# these rpms will be installed from the fedora repository +# using rpm-ostree and will be preinstalled in the final image rpms: - - python3-pip # needed for yafti + - python3-pip # needed for yafti (the first boot installer) + +# these flatpaks (from flathub) will be available for install on boot +# this is just an example selection, and even if you leave it empty, +# you'll have the basic options available in yafti flatpaks: - org.mozilla.firefox - org.mozilla.Thunderbird From c9c011d842a9ef9ec5d3976a0fd167b22ca0f0ed Mon Sep 17 00:00:00 2001 From: ER Date: Mon, 3 Apr 2023 15:23:59 +0300 Subject: [PATCH 6/6] feat: declare image description in recipe.yml --- .github/workflows/build.yml | 3 ++- recipe.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1191c67..37257b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,7 @@ jobs: - name: Gather image data from recipe run: | echo "IMAGE_NAME=$(yq '.name' ./recipe.yml)" >> $GITHUB_ENV + echo "IMAGE_DESCRIPTION=$(yq '.description' ./recipe.yml)" >> $GITHUB_ENV echo "FEDORA_MAJOR_VERSION=$(yq '.fedora-version' ./recipe.yml)" >> $GITHUB_ENV echo "BASE_CONTAINER_URL=$(yq '.base-container' ./recipe.yml)" >> $GITHUB_ENV @@ -100,7 +101,7 @@ jobs: ${{ env.IMAGE_NAME }} labels: | org.opencontainers.image.title=${{ env.IMAGE_NAME }} - org.opencontainers.image.description=A starting point for further customization of uBlue images. Make your own! https://ublue.it/making-your-own/ + org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }} io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/startingpoint/main/README.md io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4 diff --git a/recipe.yml b/recipe.yml index ae3e8dd..28a28cc 100644 --- a/recipe.yml +++ b/recipe.yml @@ -8,6 +8,9 @@ base-container: ghcr.io/ublue-os/silverblue-main # what fedora version to use, you can just change this to update fedora-version: 37 +# this description will be visible in the containers metadata +description: A starting point for further customization of uBlue images. Make your own! https://ublue.it/making-your-own/ + # these rpms will be installed from the fedora repository # using rpm-ostree and will be preinstalled in the final image rpms: