Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ on:
- cron: '0 0 * * *'

jobs:
build_base:
uses: ./.github/workflows/build_base.yml
build_nanodlp:
needs: build_base
uses: ./.github/workflows/build_variant.yml
with:
variant: nanodlp-based
image_name: ${{ needs.build_base.outputs.image_name }}
build_odyssey:
needs: build_base
uses: ./.github/workflows/build_variant.yml
with:
variant: odyssey-based
image_name: ${{ needs.build_base.outputs.image_name }}

67 changes: 67 additions & 0 deletions .github/workflows/build_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
workflow_call:
outputs:
image_name:
description: "The filename of the uploaded base image"
value: ${{ jobs.build.outputs.image_name }}

jobs:
build:
runs-on: ubuntu-latest
outputs:
image_name: ${{ steps.artifact.outputs.image }}
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install Dependencies
run: |
sudo apt update
sudo apt install coreutils p7zip-full qemu-user-static
- name: Checkout CustomPiOS
uses: actions/checkout@v4
with:
repository: 'guysoft/CustomPiOS'
path: CustomPiOS
ref: '70f1ae537a02195f1ba4f0a51ed381628e575c66'

- name: Checkout Project Repository
uses: actions/checkout@v4
with:
path: repository
submodules: true

- name: Download Raspbian Image
run: |
cd repository/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest'
- name: Update CustomPiOS Paths
run: |
cd repository/src
../../CustomPiOS/src/update-custompios-paths

- name: Build Image
id: build
run: |
sudo modprobe loop
cd repository/src
sudo bash -x ./build_dist

- name: Prepare artifact
id: artifact
run: |
source repository/src/config
NOW=$(date +"%Y-%m-%d-%H%M")
IMAGE=$NOW-prometheusos-BASE-$DIST_VERSION
cp repository/src/workspace/*.img $IMAGE.img
tar -cJf $IMAGE.img.xz $IMAGE.img
echo "image=$IMAGE" >> $GITHUB_OUTPUT
echo "dist_version=$DIST_VERSION" >> $GITHUB_OUTPUT

- uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.image }}
path: ${{ steps.artifact.outputs.image }}.img.xz
25 changes: 18 additions & 7 deletions .github/workflows/build_variant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ on:
variant:
required: true
type: string
image_name:
required: true
type: string

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install Dependencies
run: |
sudo apt update
Expand All @@ -21,15 +30,17 @@ jobs:
ref: '70f1ae537a02195f1ba4f0a51ed381628e575c66'

- name: Checkout Project Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: repository
submodules: true

- name: Download Raspbian Image
run: |
cd repository/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest'
- name: Download base image
uses: actions/download-artifact@v4
with:
name: ${{ inputs.image_name }}
path: repository/src/image

- name: Update CustomPiOS Paths
run: |
cd repository/src
Expand All @@ -49,7 +60,7 @@ jobs:
NOW=$(date +"%Y-%m-%d-%H%M")
IMAGE=$NOW-prometheusos-${{ inputs.variant }}-$DIST_VERSION
cp repository/src/workspace-${{ inputs.variant }}/*.img $IMAGE.img
tar -czvf $IMAGE.tar.gz $IMAGE.img
tar -cJf $IMAGE.img.xz $IMAGE.img
echo "image=$IMAGE" >> $GITHUB_OUTPUT
echo "dist_version=$DIST_VERSION" >> $GITHUB_OUTPUT

Expand All @@ -62,7 +73,7 @@ jobs:
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/main'
with:
artifacts: ${{ steps.compress.outputs.image }}.tar.gz
artifacts: ${{ steps.compress.outputs.image }}.img.xz
tag: v${{ steps.compress.outputs.dist_version }}
skipIfReleaseExists: true
omitBodyDuringUpdate: true
Expand Down
2 changes: 1 addition & 1 deletion src/config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export BASE_RELEASE_IMAGE_NAME="PrometheusOS"
# Prometheus Settings
export KLIPPER_REPO_SHIP="https://github.com/TheContrappostoShop/klipper.git"

export MODULES="base(pkgupgrade,network,klipper,nanodlp,odyssey,prometheus_config,openocd)"
export MODULES="base(pkgupgrade,network,auto-mount-removable,klipper,prometheus_config,openocd,user_rename)"

# Prevent known wifi issues
export NETWORK_DISABLE_PWRSAVE=no
8 changes: 5 additions & 3 deletions src/modules/prometheus_config/start_chroot_script
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ for dir in ${PROMETHEUS_CONFIG_DIRS}; do
sudo -u "${BASE_USER}" mkdir -p "${dir}"
done

sudo -u "${BASE_USER}" cp prometheus_config/klipper/.config klipper/
sudo -u "${BASE_USER}" cp prometheus_config/klipper/config/* printer_data/config/
sudo -u "${BASE_USER}" mv prometheus_config/klipper/.config klipper/
sudo -u "${BASE_USER}" mv prometheus_config/klipper/config/* printer_data/config/

# Only copy nanodlp files if neccessary
if [[ $MODULES == *"nanodlp"* ]]; then
sudo -u "${BASE_USER}" cp prometheus_config/nanodlp/* nanodlp/db/
sudo -u "${BASE_USER}" mv prometheus_config/nanodlp/* nanodlp/db/
fi

sudo -u "${BASE_USER}" rm -rf prometheus_config

# if Odyssey is included in this build, then include the relevant klipper config
# at the head of printer.cfg
if [[ $MODULES == *"odyssey"* ]]; then
Expand Down
3 changes: 2 additions & 1 deletion src/variants/nanodlp-based/config
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export MODULES="base(pkgupgrade,network,klipper,nanodlp,prometheus_config,openocd,user_rename)"
export MODULES="base(nanodlp)"
export BASE_ZIP_IMG=$(ls -t ${DIST_PATH}/image/*.xz | head -n 1)
3 changes: 2 additions & 1 deletion src/variants/odyssey-based/config
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export MODULES="base(pkgupgrade,network,auto-mount-removable,klipper,moonraker,mainsail,odyssey,prometheus_config,openocd,user_rename)"
export MODULES="base(moonraker,mainsail,odyssey)"
export BASE_ZIP_IMG=$(ls -t ${DIST_PATH}/image/*.xz | head -n 1)