Put each uninstall in its own command #124
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 (Dev branch) | |
| on: | |
| push: | |
| 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: | | |
| _commit_hash=$(git rev-parse --short HEAD) | |
| _runner_name="${RUNNER_NAME:-default-runner}" | |
| echo "${_commit_hash}" > ./Trixie/config/includes.chroot_after_packages/etc/trios/release | |
| echo "commit_hash=${_commit_hash}" >> "$GITHUB_OUTPUT" | |
| echo "runner_name=${_runner_name}" >> "$GITHUB_OUTPUT" | |
| mkdir -p ./TriOS_Output | |
| - name: Debug commit hash and runner name | |
| run: | | |
| echo "Commit hash is: ${{ steps.vars.outputs.commit_hash }}" | |
| 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-dev-${{ steps.vars.outputs.commit_hash }}.iso | |
| path: ./TriOS_Output/live-image-amd64.hybrid.iso | |