Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/template' into live
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeeler committed Jan 28, 2024
2 parents a157efb + ca69613 commit 5ebcf83
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 249 deletions.
56 changes: 41 additions & 15 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 @@ -43,26 +43,48 @@ jobs:
# !!!

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

# Checkout push-to-registry action GitHub repository
- 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.35.1
uses: mikefarah/yq@v4.40.5

- name: Gather image data from recipe
run: |
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 @@ -136,6 +158,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 Expand Up @@ -180,9 +209,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

# Sign container
- uses: sigstore/cosign-installer@v3.1.2
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live'

- name: Sign container image
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/live'
run: |
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
permissions:
contents: write
container:
image: fedora:38
image: fedora:39
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Generate ISO
uses: ublue-os/isogenerator@main
uses: ublue-os/isogenerator@v2.3.1
id: isogenerator
with:
image-name: ${{ github.event.repository.name }}
installer-repo: releases
installer-major-version: 38
installer-major-version: 39
boot-menu-path: boot_menu.yml
- name: install github CLI
run: |
Expand All @@ -35,6 +35,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
11 changes: 4 additions & 7 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# does nothing if the image is built in the cloud.

# !! Warning: changing these might not do anything for you. Read comment above.
ARG IMAGE_MAJOR_VERSION=38
ARG IMAGE_MAJOR_VERSION=39
ARG BASE_IMAGE_URL=ghcr.io/ublue-os/silverblue-main

FROM ${BASE_IMAGE_URL}:${IMAGE_MAJOR_VERSION}
Expand All @@ -20,14 +20,8 @@ ARG RECIPE=recipe.yml
# The default image registry to write to policy.json and cosign.yaml
ARG IMAGE_REGISTRY=ghcr.io/ublue-os


COPY cosign.pub /usr/share/ublue-os/cosign.pub

# Copy the bling from ublue-os/bling into tmp, to be installed later by the bling module
# Feel free to remove these lines if you want to speed up image builds and don't want any bling
COPY --from=ghcr.io/ublue-os/bling:latest /rpms /tmp/bling/rpms
COPY --from=ghcr.io/ublue-os/bling:latest /files /tmp/bling/files

# Copy build scripts & configuration
COPY build.sh /tmp/build.sh
COPY config /tmp/config/
Expand All @@ -42,6 +36,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
```

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

143 changes: 0 additions & 143 deletions config/files/usr/share/ublue-os/firstboot/yafti.yml

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
3 changes: 1 addition & 2 deletions config/files/usr/share/ublue-os/just/60-custom.just
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
!include /usr/share/ublue-os/just/100-bling.just

import '100-bling.just'
# Include some of your custom scripts here!
Loading

0 comments on commit 5ebcf83

Please sign in to comment.