-
-
Notifications
You must be signed in to change notification settings - Fork 37
48 lines (41 loc) · 1.64 KB
/
build_image.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
name: Build image
on:
push:
branches:
- '**'
pull_request:
jobs:
build_image:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set version
run: echo "ver=$(git log -1 --pretty=format:"%h")" >> "$GITHUB_ENV"
- name: Linux Release
run: git archive --prefix=MultiOS-USB_$ver/ -o MultiOS-USB_linux_$ver.tar.gz $ver
- name: Windows Release
run: |
efiPartSize="$(grep ^efi_size= multios-usb.sh | cut -f2- -d'=' | xargs)"
imageName="image.img"
imageSize=$(($(echo $efiPartSize | sed 's/\([0-9]\+\)\([A-Za-z]\)/\1/') + 2))
tmp_imageName="tmp.img"
tmp_imageSize="$(($imageSize + 50))$(echo $efiPartSize | sed 's/\([0-9]\+\)\([A-Za-z]\)/\2/')"
fallocate $tmp_imageName -l $tmp_imageSize
dev=$(sudo losetup -f -P --show $tmp_imageName)
echo "YeS" | sudo ./multios-usb.sh $dev
mkdir part_data && sudo mount ${dev}p2 part_data
(cd part_data && sudo zip -r ../files.zip *)
sudo umount ${dev}p2
sudo dd if=$dev of=$imageName bs=1M count=$imageSize
sudo sgdisk -d 2 $imageName
mv docs/README_image README.txt
sudo zip MultiOS-USB_windows_image_$ver.zip $imageName files.zip README.txt
- name: Generate SHA256SUM
run: sha256sum MultiOS-USB_windows_image_*.zip MultiOS-USB_linux_*.tar.gz > sha256sums.txt
- uses: actions/upload-artifact@v4
with:
name: MultiOS-USB_images_${{ env.ver }}
path: |
MultiOS-USB_windows_image_*.zip
MultiOS-USB_linux_*.tar.gz
sha256sums.txt