-
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (131 loc) · 3.99 KB
/
Copy pathbuilder.yaml
File metadata and controls
135 lines (131 loc) · 3.99 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: BerryOS Builder
run-name: BerryOS/${{ inputs.build_arch }} (${{ inputs.debian_release }}/${{ inputs.os_version }})
on:
workflow_call:
inputs:
debian_release:
type: string
description: "Base Debian release"
required: true
default: bookworm
os_version:
type: string
description: "OS Version"
default: "nightly"
build_arch:
type: string
description: "Target architecture"
required: true
default: armhf
outputs:
image:
description: "Image filename"
value: ${{ jobs.image.outputs.filename }}
checksum:
description: "Image checksum"
value: ${{ jobs.image.outputs.checksum }}
artifact_id:
description: "Artifact name"
value: ${{ jobs.image.outputs.artifact_id }}
workflow_dispatch:
inputs:
debian_release:
type: choice
description: "Base Debian release"
required: true
default: bookworm
options:
- bullseye
- bookworm
- trixie
os_version:
type: string
description: "OS Version"
default: "nightly"
build_arch:
type: choice
description: "Target architecture"
required: true
default: armhf
options:
- armhf
- arm64
defaults:
run:
shell: bash
jobs:
rootfs:
runs-on: ubuntu-latest
container:
image: ghcr.io/0rax/berryos-builder
options: --privileged
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
BUILD_DIR: ${{ github.workspace }}
OUTPUT_DIR: ${{ github.workspace }}/out
OS_VERSION: ${{ inputs.os_version }}
GIT_HASH: ${{ github.sha }}
DEBIAN_RELEASE: ${{ inputs.debian_release }}
BUILD_ARCH: ${{ inputs.build_arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Bootstrap rootfs
run: |
./scripts/00-bootstrap.sh
- name: Upload rootfs
uses: actions/upload-artifact@v4
with:
name: berryos-${{ inputs.build_arch }}-rootfs
path: |
out/berryos-${{ inputs.build_arch }}-${{ inputs.debian_release }}-*-rootfs.tar.xz
out/berryos-${{ inputs.build_arch }}-${{ inputs.debian_release }}-*-packages.txt
image:
needs: rootfs
runs-on: ubuntu-latest
container:
image: ghcr.io/0rax/berryos-builder
options: --privileged
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
volumes:
- berryos-output:/tmp/berryos-output
outputs:
filename: ${{ steps.checksum.outputs.image }}
checksum: ${{ steps.checksum.outputs.checksum }}
artifact_id: ${{ steps.artifact.outputs.artifact-id }}
env:
BUILD_DIR: ${{ github.workspace }}
OUTPUT_DIR: ${{ github.workspace }}/out
OS_VERSION: ${{ inputs.os_version }}
DEBIAN_RELEASE: ${{ inputs.debian_release }}
BUILD_ARCH: ${{ inputs.build_arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download rootfs
uses: actions/download-artifact@v4
with:
name: berryos-${{ inputs.build_arch }}-rootfs
path: out/
- name: Export image
run: |
./scripts/10-export.sh
- name: Generate checksum
id: checksum
run: |
IMAGE="berryos-${{ inputs.build_arch }}-${{ inputs.debian_release }}-${OS_VERSION//.}.img.xz"
sha256sum "out/${IMAGE}" > "out/${IMAGE}.sha256"
echo "image=${IMAGE}" | tee -a "${GITHUB_OUTPUT}"
echo "checksum=$(cat out/${IMAGE}.sha256)" | tee -a "${GITHUB_OUTPUT}"
- name: Upload image
id: artifact
uses: actions/upload-artifact@v4
with:
name: berryos-${{ inputs.build_arch }}-image
path: |
out/${{ steps.checksum.outputs.image }}
out/${{ steps.checksum.outputs.image }}.sha256