forked from dpowers86/debian-live
-
-
Notifications
You must be signed in to change notification settings - Fork 903
47 lines (39 loc) · 1.53 KB
/
build-haos.yml
File metadata and controls
47 lines (39 loc) · 1.53 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
name: "Build HAOS Installer ISO"
on:
workflow_dispatch:
inputs:
download_url:
description: '请输入haos下载地址(扩展名 .img.gz/.img.xz/.img.zip)'
required: true
default: 'https://github.com/home-assistant/operating-system/releases/download/15.0/haos_generic-x86-64-15.0.img.xz'
jobs:
build-release:
name: "Build and Release"
runs-on: "ubuntu-22.04"
steps:
- name: "Checking out git repository"
uses: actions/checkout@v2
- name: Set executable permissions
run: |
chmod +x "${{ github.workspace }}/haos.sh"
chmod +x "${{ github.workspace }}/supportFiles/haos/build.sh"
- name: Validate Download URL
run: |
USER_INPUT_URL="${{ github.event.inputs.download_url }}"
if [[ ! "$USER_INPUT_URL" =~ ^https?://.+\.[gG][zZ]$|^https?://.+\.[xX][zZ]$|^https?://.+\.[zZ][iI][pP]$ ]]; then
echo "❌ 错误:地址需以 http(s) 开头且扩展名为 .gz/.xz/.zip"
echo "当前输入:$USER_INPUT_URL"
exit 1
fi
- name: "Build Image"
run: |
download_url="${{ github.event.inputs.download_url }}"
./haos.sh "$download_url"
- name: "Publish"
uses: softprops/action-gh-release@v2.2.1
with:
tag_name: "HAOS-Installer-x86_64-ISO"
body_path: "${{ github.workspace }}/supportFiles/haos/info.md"
files: |
output/haos-installer-x86_64.iso
token: "${{ secrets.GITHUB_TOKEN }}"