Skip to content

Commit 6304383

Browse files
authored
Merge pull request #84 from OS2borgerPC/83-github-build-pipepline
issue #83 - add github build pipeline
2 parents b9d09f3 + 7acda56 commit 6304383

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build_iso.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build and Release Custom Ubuntu ISO
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
release:
9+
types: [created]
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-and-release-iso:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Set up cache for Ubuntu ISO
21+
id: cache-ubuntu-iso
22+
uses: actions/cache@v3
23+
with:
24+
path: ubuntu-22.04.4-desktop-amd64.iso
25+
key: ubuntu-iso-${{ runner.os }}-${{ hashFiles('ubuntu-22.04.4-desktop-amd64.iso') }}
26+
restore-keys: |
27+
ubuntu-iso-${{ runner.os }}-
28+
29+
- name: Download Ubuntu ISO if not cached
30+
if: steps.cache-ubuntu-iso.outputs.cache-hit != 'true'
31+
run: |
32+
wget -O ubuntu-22.04.4-desktop-amd64.iso https://releases.ubuntu.com/22.04.4/ubuntu-22.04.4-desktop-amd64.iso
33+
34+
- name: Determine ISO filename
35+
id: get-filename
36+
run: |
37+
if [[ "${{ github.event_name }}" == "release" ]]; then
38+
echo "FILENAME=borgerpc-amd64-${{ github.event.release.tag_name }}" >> $GITHUB_ENV
39+
else
40+
echo "FILENAME=borgerpc-amd64-dev" >> $GITHUB_ENV
41+
fi
42+
43+
- name: Build OS2borgerpc image
44+
run: |
45+
cd image && ./build_os2borgerpc_image.sh ../ubuntu-22.04.4-desktop-amd64.iso $FILENAME
46+
47+
- name: Upload ISO as an artifact (for non-release events)
48+
if: github.event_name != 'release'
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: ${{ env.FILENAME }}.iso
52+
path: ./image/${{ env.FILENAME }}.iso
53+
54+
- name: Upload ISO to release (only for release events)
55+
if: github.event_name == 'release'
56+
uses: actions/upload-release-asset@v1
57+
with:
58+
upload_url: ${{ github.event.release.upload_url }}
59+
asset_path: ./image/${{ env.FILENAME }}.iso
60+
asset_name: ${{ env.FILENAME }}.iso
61+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)