This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
forked from JasonN3/build-container-installer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
142 lines (132 loc) · 5.11 KB
/
action.yml
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
136
137
138
139
140
141
142
name: Generate ISO
description: Creates an ISO for installing an OSTree container
inputs:
ARCH:
description: Architecture for image to build
required: true
default: x86_64
IMAGE_NAME:
description: Name of the source container image
required: true
default: base-main
IMAGE_REPO:
description: Repository containing the source container image
required: true
default: ghcr.io/ublue-os
VARIANT:
description: "Source container variant. Available options can be found by running `dnf provides system-release`. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinonite"
required: true
default: Kinoite
VERSION:
description: Fedora version of installer to build
required: true
default: "39"
IMAGE_TAG:
description: Tag of the source container image
required: false
EXTRA_BOOT_PARAMS:
description: Extra params used by grub to boot the anaconda installer
required: false
WEB_UI:
description: Enable Anaconda WebUI
required: true
default: "false"
ENROLLMENT_PASSWORD:
description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined)
required: false
default: "ublue-os"
SECURE_BOOT_KEY_URL:
description: Secure boot key that is installed from URL location
required: false
ACTION_REPO:
deprecationMessage: This variable is no longer used and will be removed in a future version
required: false
ACTION_REF:
deprecationMessage: This variable is no longer used and will be removed in a future version
required: false
outputs:
output-directory:
value: ${{ steps.final.outputs.OUTPUT_DIR }}
iso-path:
value: ${{ steps.final.outputs.ISO_PATH }}
checksum-path:
value: ${{ steps.final.outputs.CHECKSUM_PATH }}
runs:
using: composite
steps:
- name: Cleanup host
shell: bash
run: |
if [[ -d /host ]]
then
df -h /host
# Remove Android Library
rm -Rf /host/usr/local/lib/android
# Remove .NET runtime
rm -Rf /host/usr/share/dotnet
# Remove Haskell runtime
rm -rf /host/opt/ghc
rm -rf /host/usr/local/.ghcup
chroot /host docker image prune --all --force
df -h /host
else
echo "Host must be mounted as /host in order to make more space"
fi
- name: Install Make
shell: bash
run: dnf install -y make
- name: Install dependencies
shell: bash
working-directory: ${{ github.action_path }}
run: make install-deps
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ inputs.IMAGE_REPO }}
- name: Download image
shell: bash
working-directory: ${{ github.action_path }}
run: |
make container/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }} \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }}
- name: Create boot.iso
shell: bash
working-directory: ${{ github.action_path }}
run: |
make boot.iso \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }} \
EXTRA_BOOT_PARAMS=${{ inputs.EXTRA_BOOT_PARAMS }} \
SECURE_BOOT_KEY_URL=${{ inputs.SECURE_BOOT_KEY_URL }} \
ENROLLMENT_PASSWORD=${{ inputs.ENROLLMENT_PASSWORD }}
- name: Create deploy.iso and generate sha256 checksum
shell: bash
id: final
working-directory: ${{ github.action_path }}
run: |
make ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso \
ARCH=${{ inputs.ARCH }} \
IMAGE_NAME=${{ inputs.IMAGE_NAME }} \
IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \
IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \
VARIANT=${{ inputs.VARIANT }} \
VERSION=${{ inputs.VERSION }} \
WEB_UI=${{ inputs.WEB_UI }}
mkdir end_iso
sha256sum ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso > ./end_iso/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}-CHECKSUM
mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/
echo "OUTPUT_DIR=$(realpath ./end_iso)" >> $GITHUB_OUTPUT
echo "ISO_PATH=$(realpath ./end_iso/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso)" >> $GITHUB_OUTPUT
echo "CHECKSUM_PATH=$(realpath ./end_iso/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}-CHECKSUM)" >> $GITHUB_OUTPUT