github action to build exsi installation iso

本文最后更新于:2024年8月9日 晚上

---

Source project

https://github.com/Jas0n0ss/exsi-customize-iso

Basic build workflow

  • Build Powershell env with python3.7
  • Install python modules: six psutil lxml pyopenssl
  • Install VMware.Powercli
  • Download ESXi-Customizer-PS Powershell script
  • Use ESXi-Customizer-PS script generate customized ISO
  • Upload customized ISO and build log to GitHub release

Github Action Workflow

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
name: EXSi_60_sata_Net55-r8168
on:
repository_dispatch:
workflow_dispatch:
inputs:
tag:
description: 'Release Tag'
required: true
default: 'EXSI6.0-net55-r8168'
driver:
description: 'Driver Name'
required: true
default: 'net55-r8168'

jobs:
Build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.7'

- name: Download ESXi-Customizer-PS Script
shell: powershell
run: |
$client = new-object System.Net.WebClient
$client.DownloadFile('https://github.com/VFrontDe/ESXi-Customizer-PS/archive/refs/tags/2.9.0.zip','ESXi-Customizer-PS.zip')
Expand-Archive -Path ESXi-Customizer-PS.zip -DestinationPath ./
cd ESXi-Customizer-PS-2.9.0
$env:WORK_DIR=$PWD
$env:WORK_DIR
echo "WORK_DIR=$env:WORK_DIR" | Out-File -FilePath $env:GlinuxHUB_ENV -Encoding utf8 -Append

- name: Install VMware.PowerCLI and Python dependency
shell: powershell
run: |
Install-Module -Name VMware.PowerCLI -AcceptLicense -Force -SkipPublisherCheck
pip3.exe install six psutil lxml pyopenssl

- name: Download exsi6.0 Base image
shell: powershell
run: |
cd $env:WORK_DIR\
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Export-ESXImageProfile -ImageProfile "ESXi-6.0.0-20200204001-standard" -ExportToBundle -filepath ESXi-6.0.0-20200204001-standard.zip

- name: Generate EXSi ISO File
shell: powershell
run: |
cd $env:WORK_DIR\
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
.\ESXi-Customizer-PS.ps1 -izip .\ESXi-6.0.0-20200204001-standard.zip -nsc -log ..\build-log.txt -v60 -vft -load sata-xahci,net55-r8168 -ipname ${{ github.event.inputs.tag }} -outDir ..\
dir ..\

- name: Create Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.TOKEN }}
name: ${{ github.event.inputs.tag }}
tag_name: ${{ github.event.inputs.tag }}
files: |
build-log.txt
${{ github.event.inputs.tag }}.iso

image-20230215132204242


github action to build exsi installation iso
https://git.msft.vip/2023/02/15-github-action-to-build-exsi-installation-iso/
作者
Jas0n0ss
发布于
2023年2月15日
更新于
2024年8月9日
许可协议