Build TriOS ISO (Nightly) #60
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build TriOS ISO (Nightly) | |
| on: | |
| schedule: | |
| # Runs every day at 07:00 UTC | |
| - cron: "0 7 * * *" | |
| workflow_dispatch: | |
| branches: | |
| - dev | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-trios: | |
| name: Build and Package ISO | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up version file and variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| _timestamp=$(date -u +"%Y-%m-%dT%H-%M-%SZ") | |
| _runner_name="${RUNNER_NAME:-default-runner}" | |
| echo "${_timestamp}" > ./Trixie/config/includes.chroot_after_packages/etc/trios/release | |
| echo "timestamp=${_timestamp}" >> "$GITHUB_OUTPUT" | |
| echo "runner_name=${_runner_name}" >> "$GITHUB_OUTPUT" | |
| mkdir -p ./TriOS_Output | |
| - name: Debug timestamp and runner name | |
| run: | | |
| echo "Timestamp is: ${{ steps.vars.outputs.timestamp }}" | |
| echo "Runner name is: ${{ steps.vars.outputs.runner_name }}" | |
| - name: Stop and Remove Old Container and Image (if exists) | |
| run: | | |
| _container_name="trios-builder-${{ steps.vars.outputs.runner_name }}" | |
| _image_name="trios-builder-${{ steps.vars.outputs.runner_name }}" | |
| # Stop and remove any container with this name | |
| if [ "$(docker ps -aq -f name=^${_container_name}$)" ]; then | |
| echo "Stopping existing container: ${_container_name}" | |
| docker stop "${_container_name}" || true | |
| echo "Removing existing container: ${_container_name}" | |
| docker rm -f "${_container_name}" || true | |
| fi | |
| # Remove old image if exists | |
| if [ "$(docker images -q ${_image_name})" ]; then | |
| echo "Removing old image: ${_image_name}" | |
| docker rmi -f "${_image_name}" || true | |
| fi | |
| - name: Build Docker Image | |
| working-directory: ./builder | |
| run: | | |
| docker build -t trios-builder-${{ steps.vars.outputs.runner_name }} . | |
| - name: Run Docker Container (Privileged) | |
| run: | | |
| docker run -i \ | |
| --privileged \ | |
| --name "trios-builder-${{ steps.vars.outputs.runner_name }}" \ | |
| -v "./Trixie:/TriOS" \ | |
| -v "./TriOS_Output:/TriOS_Output" \ | |
| "trios-builder-${{ steps.vars.outputs.runner_name }}" | |
| - name: Verify ISO Output | |
| run: | | |
| ls -lh ./TriOS_Output || true | |
| - name: Upload ISO Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: trios-nightly-${{ steps.vars.outputs.timestamp }}.iso | |
| path: ./TriOS_Output/live-image-amd64.hybrid.iso | |