Skip to content

Commit

Permalink
Heavily optimize building workflow and further automate development p…
Browse files Browse the repository at this point in the history
…rocess
  • Loading branch information
Minionguyjpro committed Oct 12, 2024
1 parent 12fa02a commit 8826523
Show file tree
Hide file tree
Showing 11 changed files with 104 additions and 298 deletions.
96 changes: 65 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,60 @@ name: Build EXE application, installer and disk image

on:
push:
branches: [ main ]
branches: [ '*']
tags: [ 'v*' ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
REPO_PATH: 'D:\a\WinUEFI\WinUEFI'

jobs:
set_version:
name: Set version variable
runs-on: ubuntu-latest
steps:

- name: Set VERSION for branch
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/')
run: echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV

- name: Set VERSION for tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV

- name: Set VERSION for pull request
if: github.event_name == 'pull_request'
run: echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV

- name: Set VERSION for manual dispatch
if: github.event_name == 'workflow_dispatch'
run: echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV

build_exe:
name: Build EXE
runs-on: windows-latest
strategy:
matrix:
arch: [amd64, i386]
arch_name: [x64, x86]
arch_name_full: [64-bit, 32-bit]
steps:

- uses: actions/checkout@v3

- name: Temporary copy source files
run: copy "%REPO_PATH%\src\*" "%REPO_PATH%\build\*"
- name: Make build directory
run: mkdir build
shell: cmd

- name: Build BAT to EXE application
run: |
"%REPO_PATH%\bin\bat_to_exe\bat_to_exe.exe" /bat "%REPO_PATH%\src\WinUEFI-console.bat" /exe "%REPO_PATH%\build\WinUEFI-console.exe" /x64 /icon "%REPO_PATH%\src\logo.ico" /uac-admin /productversion "${{ env.RELEASE_VERSION }}" /internalname "WinUEFI 64-bit"
"%REPO_PATH%\bin\bat_to_exe\bat_to_exe.exe" /bat "%REPO_PATH%\src\WinUEFI.bat" /exe "%REPO_PATH%\build\WinUEFI.exe" /x64 /invisible /icon "%REPO_PATH%\src\logo.ico" /uac-admin /productversion "${{ env.RELEASE_VERSION }}" /internalname "WinUEFI 64-bit"
"%REPO_PATH%\bin\bat_to_exe\bat_to_exe.exe" /bat "%REPO_PATH%\src\WinUEFI-console.bat" /exe "%REPO_PATH%\build\WinUEFI-x86-console.exe" /icon "%REPO_PATH%\src\logo.ico" /uac-admin /productversion "${{ env.RELEASE_VERSION }}" /internalname "WinUEFI 32-bit"
"%REPO_PATH%\bin\bat_to_exe\bat_to_exe.exe" /bat "%REPO_PATH%\src\WinUEFI.bat" /exe "%REPO_PATH%\build\WinUEFI-x86.exe" /icon /invisible "%REPO_PATH%\src\logo.ico" /uac-admin /productversion "${{ env.RELEASE_VERSION }}" /internalname "WinUEFI 32-bit"
"${{ github.workspace }}\bin\bat_to_exe\bat_to_exe.exe" /bat "${{ github.workspace }}\src\WinUEFI-console.bat" /exe "${{ github.workspace }}\build\WinUEFI-${{ matrix.arch }}-console.exe" /${{ matrix.arch_name }} /icon "${{ github.workspace }}\src\logo.ico" /uac-admin /productversion "${{ env.VERSION }}" /internalname "WinUEFI ${{ matrix.arch_name_full }}"
"${{ github.workspace }}\bin\bat_to_exe\bat_to_exe.exe" /bat "${{ github.workspace }}\src\WinUEFI.bat" /exe "${{ github.workspace }}\build\WinUEFI-${{ matrix.arch }}.exe" /${{ matrix.arch_name }} /invisible /icon "${{ github.workspace }}\src\logo.ico" /uac-admin /productversion "${{ env.VERSION }}" /internalname "WinUEFI ${{ matrix.arch_name_full }}"
shell: cmd

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: WinUEFI
path: |
build/*.exe
build/*.iso
build/*.bat
build/*.ps1
build/*.py
build/*.txt
path: build/*.exe

build_installer:
name: Build installer
Expand All @@ -52,11 +67,15 @@ jobs:

- uses: actions/checkout@v3

- name : Make build directory
run: mkdir build
shell: cmd

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: WinUEFI
path: build/
path: build

- name: Build the EXE installer
run: |
Expand All @@ -67,7 +86,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: WinUEFI
path: "build/WinUEFI-setup.exe"
path: build/WinUEFI-setup.exe

build_disk_images:
name: Build disk images (.ISO and .IMG)
Expand All @@ -81,18 +100,18 @@ jobs:
uses: actions/download-artifact@v3
with:
name: WinUEFI
path: build/
path: build

- name: Copy setup
run: copy "%REPO_PATH%\build\WinUEFI-setup.exe" "%REPO_PATH%\src\ISO\autorun.exe"
run: copy "${{ github.workspace }}\build\WinUEFI-setup.exe" "${{ github.workspace }}\src\ISO\autorun.exe"
shell: cmd

- name: Create .ISO disk image
run: '"%REPO_PATH%\bin\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDINPUTMODE STANDARD /BUILDOUTPUTMODE IMAGEFILE /SRC "%REPO_PATH%\src\ISO\" /DEST "%REPO_PATH%\build\WinUEFI-setup.iso" /FILESYSTEM "ISO9660 + Joliet" /VOLUMELABEL_ISO9660 "WinUEFI Setup" /VOLUMELABEL_JOLIET "WinUEFI-Setup" /OVERWRITE YES /ROOTFOLDER YES /START /CLOSE /NOIMAGEDETAILS'
run: '"${{ github.workspace }}\bin\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDINPUTMODE STANDARD /BUILDOUTPUTMODE IMAGEFILE /SRC "${{ github.workspace }}\src\ISO" /DEST "${{ github.workspace }}\build\WinUEFI-setup.iso" /FILESYSTEM "ISO9660 + Joliet" /VOLUMELABEL_ISO9660 "WinUEFI Setup" /VOLUMELABEL_JOLIET "WinUEFI-Setup" /OVERWRITE YES /ROOTFOLDER YES /START /CLOSE /NOIMAGEDETAILS'
shell: cmd

- name: Create .IMG disk image
run: '"%REPO_PATH%\bin\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDINPUTMODE STANDARD /BUILDOUTPUTMODE IMAGEFILE /SRC "%REPO_PATH%\src\ISO\" /DEST "%REPO_PATH%\build\WinUEFI-setup.img" /FILESYSTEM "ISO9660 + Joliet" /VOLUMELABEL_ISO9660 "WinUEFI Setup" /VOLUMELABEL_JOLIET "WinUEFI-Setup" /OVERWRITE YES /ROOTFOLDER YES /START /CLOSE /NOIMAGEDETAILS'
run: '"${{ github.workspace }}\bin\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDINPUTMODE STANDARD /BUILDOUTPUTMODE IMAGEFILE /SRC "${{ github.workspace }}\src\ISO" /DEST "${{ github.workspace }}\build\WinUEFI-setup.img" /FILESYSTEM "ISO9660 + Joliet" /VOLUMELABEL_ISO9660 "WinUEFI Setup" /VOLUMELABEL_JOLIET "WinUEFI-Setup" /OVERWRITE YES /ROOTFOLDER YES /START /CLOSE /NOIMAGEDETAILS'
shell: cmd

- name: Upload artifact
Expand All @@ -105,7 +124,7 @@ jobs:
build/*.mds
build/*.dvd
get_file_checksums:
get_checksums_and_release:
name: Get file checksums
needs: [build_exe, build_installer, build_disk_images]
runs-on: ubuntu-latest
Expand All @@ -117,7 +136,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: WinUEFI
path: build/
path: build

- name: Generate checksums
uses: jmgilman/actions-generate-checksum@v1
Expand All @@ -126,16 +145,31 @@ jobs:
patterns: |
build/*.exe
build/*.iso
build/*.bat
build/*.ps1
build/*.py
build/*.iso
build/*.img
build/*.mds
build/*.dvd
src/*.bat
src/*.ps1
src/*.py
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: WinUEFI
path: "build/checksums.txt"
path: build/checksums.txt

- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
title: "WinUEFI ${{ env.VERSION }}"
files: |
build/*.txt
build/*.exe
build/*.iso
build/*.img
build/*.mds
build/*.dvd
src/*.bat
src/*.ps1
src/*.py
140 changes: 0 additions & 140 deletions .github/workflows/nightly_build.yml

This file was deleted.

4 changes: 0 additions & 4 deletions src/ISO_nightly/autorun.inf

This file was deleted.

Binary file removed src/ISO_nightly/manual/EN/WinUEFI User Manual.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions src/WinUEFI-console.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@echo off
set VERSION=${{ github.REF_NAME }}
echo WinUEFI %VERSION% by FreakinSoftMania
echo WinUEFI by FreakinSoftMania
if %VERSION%=="" (
echo WinUEFI by FreakinSoftMania
) else (
echo WinUEFI %VERSION% by FreakinSoftMania
)
timeout /t 3 > nul
echo Rebooting in 3...
timeout /nobreak /t 1 > nul
Expand Down
Loading

0 comments on commit 8826523

Please sign in to comment.