-
Notifications
You must be signed in to change notification settings - Fork 5
61 lines (52 loc) · 1.93 KB
/
build_iso.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
name: Build and Release Custom Ubuntu ISO
on:
push:
branches:
- main
- master
release:
types: [created]
workflow_dispatch:
jobs:
build-and-release-iso:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up cache for Ubuntu ISO
id: cache-ubuntu-iso
uses: actions/cache@v3
with:
path: ubuntu-22.04-desktop-amd64.iso
key: ubuntu-iso-${{ runner.os }}-${{ hashFiles('ubuntu-22.04-desktop-amd64.iso') }}
restore-keys: |
ubuntu-iso-${{ runner.os }}-
- name: Download Ubuntu ISO if not cached
if: steps.cache-ubuntu-iso.outputs.cache-hit != 'true'
run: |
wget -O ubuntu-22.04-desktop-amd64.iso https://old-releases.ubuntu.com/releases/jammy/ubuntu-22.04-desktop-amd64.iso
- name: Determine ISO filename
id: get-filename
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "FILENAME=borgerpc-amd64-${{ github.event.release.tag_name }}" >> $GITHUB_ENV
else
echo "FILENAME=borgerpc-amd64-dev" >> $GITHUB_ENV
fi
- name: Build OS2borgerpc image
run: |
cd image && ./build_os2borgerpc_image.sh ../ubuntu-22.04-desktop-amd64.iso $FILENAME
- name: Upload ISO as an artifact (for non-release events)
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: ${{ env.FILENAME }}.iso
path: ./image/${{ env.FILENAME }}.iso
- name: Upload ISO to release (only for release events)
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./image/${{ env.FILENAME }}.iso
asset_name: ${{ env.FILENAME }}.iso
asset_content_type: application/octet-stream