Skip to content

Commit

Permalink
Merge pull request #8 from alextrical/template
Browse files Browse the repository at this point in the history
[pull] live from template
  • Loading branch information
pull[bot] authored Jan 27, 2024
2 parents a940848 + 535ed93 commit 5b61212
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 13 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ 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
Expand Down Expand Up @@ -84,7 +77,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/[email protected]
with:
containers: ${{ env.BASE_IMAGE_NAME }}:${{ env.IMAGE_MAJOR_VERSION }}

- name: Get current version
id: labels
Expand Down Expand Up @@ -158,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
2 changes: 1 addition & 1 deletion .github/workflows/release-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Generate ISO
uses: ublue-os/isogenerator@v2.2.0
uses: ublue-os/isogenerator@v2.3.1
id: isogenerator
with:
image-name: ${{ 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
```
2 changes: 1 addition & 1 deletion config/files/usr/share/ublue-os/just/60-custom.just
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
!include 100-bling.just
import '100-bling.just'
# Include some of your custom scripts here!
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 5b61212

Please sign in to comment.