Updated README.md #101
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build image | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
jobs: | |
build_image: | |
runs-on: ubuntu-22.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 |