-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (64 loc) · 2.59 KB
/
build-trios-trixie-dev.yml
File metadata and controls
79 lines (64 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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