Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
chore: merge branch 'template' into live
Browse files Browse the repository at this point in the history
  • Loading branch information
scottames committed Jan 27, 2024
2 parents 9e6863e + 95f5265 commit d513510
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 67 deletions.
44 changes: 40 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This workflow builds every branch of the repository daily at 20:22 UTC, one hour after ublue-os/nvidia builds.
# The images are also built after pushuing changes or pull requests.
# This workflow builds every branch of the repository daily at 16:30 UTC, one hour after ublue-os/nvidia builds.
# The images are also built after pushing changes or pull requests.
# The builds can also be triggered manually in the Actions tab thanks to workflow dispatch.
# Only the branch called `live` is published.


name: build-ublue
on: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
schedule:
- cron: "20 22 * * *"
- cron: "30 16 * * *"
push:
branches:
- live
Expand Down Expand Up @@ -56,6 +56,28 @@ jobs:
- name: Checkout Push to Registry action
uses: actions/checkout@v4

# Confirm that cosign.pub matches SIGNING_SECRET
- uses: sigstore/cosign-installer@v3.3.0
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live'

- name: Check SIGNING_SECRET matches cosign.pub
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live'
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PASSWORD: ""
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
shell: bash
run: |
echo "Checking for difference between public key from SIGNING_SECRET and cosign.pub"
delta=$(diff -u <(cosign public-key --key env://COSIGN_PRIVATE_KEY) cosign.pub)
if [ -z "$delta" ]; then
echo "cosign.pub matches SIGNING_SECRET"
else
echo "cosign.pub does not match SIGNING_SECRET"
echo "$delta"
exit 1
fi
- name: Add yq (for reading recipe.yml)
uses: mikefarah/yq@v4.40.5

Expand All @@ -64,7 +86,14 @@ jobs:
echo "IMAGE_NAME=$(yq '.name' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_DESCRIPTION=$(yq '.description' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "IMAGE_MAJOR_VERSION=$(yq '.image-version' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
echo "BASE_IMAGE_URL=$(yq '.base-image' ./config/${{ matrix.recipe }})" >> $GITHUB_ENV
BASE_IMAGE=$(yq '.base-image' ./config/${{ matrix.recipe }})
echo "BASE_IMAGE_URL=$BASE_IMAGE" >> $GITHUB_ENV
echo "BASE_IMAGE_NAME=$(echo $BASE_IMAGE | sed 's/.*\/.*\///')" >> $GITHUB_ENV
- name: Verify base image
uses: EyeCantCU/cosign-action/verify@v0.2.2
with:
containers: ${{ env.BASE_IMAGE_NAME }}:${{ env.IMAGE_MAJOR_VERSION }}

- name: Get current version
id: labels
Expand Down Expand Up @@ -138,6 +167,13 @@ jobs:
with:
string: ${{ env.IMAGE_NAME }}

- name: Maximize build space
uses: AdityaGarg8/remove-unwanted-software@v2
with:
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'

# Build image using Buildah action
- name: Build Image
id: build_image
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Generate ISO
uses: ublue-os/isogenerator@v2.2.0
- name: Generate ISO
uses: ublue-os/isogenerator@v2.3.1
id: isogenerator
with:
image-name: ${{ github.event.repository.name }}
Expand All @@ -36,6 +36,7 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: |
if gh release list -R ${{ github.repository_owner }}/${{ github.event.repository.name }} | grep "auto-iso"; then
gh release view auto-iso -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --json assets -q .assets[].name | xargs --no-run-if-empty -L 1 gh release delete-asset auto-iso -R ${{ github.repository_owner }}/${{ github.event.repository.name }}
gh release upload auto-iso ${{ steps.isogenerator.outputs.iso-path }} -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --clobber
else
gh release create auto-iso ${{ steps.isogenerator.outputs.iso-path }} -t ISO -n "This is an automatically generated ISO release." -R ${{ github.repository_owner }}/${{ github.event.repository.name }}
Expand Down
3 changes: 3 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ COPY modules /tmp/modules/
# It is copied from the official container image since it's not available as an RPM.
COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq

# Change this if you want different version/tag of akmods.
COPY --from=ghcr.io/ublue-os/akmods:main-39 /rpms /tmp/rpms

# Run the build script, then clean up temp files and finalize container build.
RUN chmod +x /tmp/build.sh && /tmp/build.sh && \
rm -rf /tmp/* /var/* && ostree container commit
18 changes: 16 additions & 2 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This repository fetches some useful default modules from [`ublue-os/bling`](http

For a comprehensive list of modules, their in-depth documentation and example configuration, check out [the Modules page on the website](https://universal-blue.org/tinker/modules/).

### Building multiple images and including module configuration from other files and
### Building multiple images and including module configuration from other files

To build multiple images, you need to create another recipe.yml file, which you should name based on what kind of image you want it to build. Then, edit the [`build.yml`](../.github/workflows/build.yml) file. Inside the file, under `jobs: strategy: matrix:`, there's a list of recipe files to build images, which you need to add your new recipe file to. These should be paths to files inside the `config` directory.

Expand All @@ -39,4 +39,18 @@ install:
- dunst
- rofi
- kitty
```
```
An external module can also include multiple modules.
```yaml
# config/common.yml
modules:
- type: files
files:
- usr: /usr
- type: rpm-ostree
install:
- i3
- dunst
- rofi
- kitty
```
13 changes: 0 additions & 13 deletions config/common-yafti.yml

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

2 changes: 2 additions & 0 deletions config/files/usr/share/ublue-os/just/100-bling.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# this file is a placeholder,
# making changes here is not supported
2 changes: 2 additions & 0 deletions config/files/usr/share/ublue-os/just/60-custom.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '100-bling.just'
# Include some of your custom scripts here!
6 changes: 0 additions & 6 deletions config/recipe-nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@ modules:
# configuration you wish to end up in /etc/ on the booted system
# should be added into /usr/etc/ as that is the proper "distro"
# config directory on ostree. Read more in the files module's README

- type: bling # configure what to pull in from ublue-os/bling
install:
# - ublue-update # https://github.com/ublue-os/ublue-update
- dconf-update-service # a service unit that updates the dconf db on boot
- from-file: common-yafti.yml
5 changes: 0 additions & 5 deletions config/recipe-surface.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ modules:
- type: files
files:
- usr: /usr
- type: bling
install:
# - ublue-update # https://github.com/ublue-os/ublue-update
- dconf-update-service
- from-file: common-yafti.yml
6 changes: 0 additions & 6 deletions config/recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@ modules:
# configuration you wish to end up in /etc/ on the booted system
# should be added into /usr/etc/ as that is the proper "distro"
# config directory on ostree. Read more in the files module's README

- type: bling # configure what to pull in from ublue-os/bling
install:
# - ublue-update # https://github.com/ublue-os/ublue-update
- dconf-update-service # a service unit that updates the dconf db on boot
- from-file: common-yafti.yml
2 changes: 1 addition & 1 deletion modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Each module intended for public usage should include a `README.md` file inside i

Modules get only the configuration options given to them in the recipe.yml, not the configuration of other modules or any top-level keys. The configuration is given as the first argument as a single-line json string. You can check out the default modules for examples on how to parse such string using `yq` or `jq`.

Additionally, each module has access to four environment variables, `CONFIG_DIRECTORY` pointing to the Startingpoint directory in `/usr/share/ublue-os/`, `IMAGE_NAME` being the name of the image as declared in the recipe, `BASE_IMAGE` being the URL of the container image used as the base (FROM) in the image, and `OS_VERSION` being the `VERSION_ID` from `/usr/lib/os-release`.
Additionally, each module has access to four environment variables, `CONFIG_DIRECTORY` pointing to the directory containing the confiuration files for the build (`/tmp/config`), `IMAGE_NAME` being the name of the image as declared in the recipe, `BASE_IMAGE` being the URL of the container image used as the base (FROM) in the image, and `OS_VERSION` being the `VERSION_ID` from `/usr/lib/os-release`.

When running modules, the working directory is the `CONFIG_DIRECTORY`.

Expand Down

0 comments on commit d513510

Please sign in to comment.