Update build.yml #152
Workflow file for this run
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
# The workflow for building the stable (regular) version of WinUEFI | |
name: Build EXE application, installer and disk image | |
on: | |
push: | |
branches: [ '*' ] | |
tags: [ 'v*' ] | |
pull_request: | |
workflow_dispatch: | |
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: | |
config: | |
- { arch: amd64, arch_name: x64, arch_name_full: "64-bit" } | |
- { arch: i386, arch_name: x86, arch_name_full: "32-bit" } | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Make build directory | |
run: mkdir build | |
shell: cmd | |
- name: Build BAT to EXE application | |
run: | | |
"${{ github.workspace }}\bin\bat_to_exe\bat_to_exe.exe" /bat "${{ github.workspace }}\src\WinUEFI-console.bat" /exe "${{ github.workspace }}\build\WinUEFI-${{ matrix.config.arch }}-console.exe" /${{ matrix.config.arch_name }} /icon "${{ github.workspace }}\src\logo.ico" /uac-admin /productversion "%VERSION%" /internalname "WinUEFI ${{ matrix.config.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.config.arch }}.exe" /${{ matrix.config.arch_name }} /invisible /icon "${{ github.workspace }}\src\logo.ico" /uac-admin /productversion "%VERSION%" /internalname "WinUEFI ${{ matrix.config.arch_name_full }}" | |
shell: cmd | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: WinUEFI | |
path: build/*.exe | |
build_installer: | |
name: Build installer | |
needs: build_exe | |
runs-on: windows-latest | |
steps: | |
- 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 | |
- name: Build the EXE installer | |
run: | | |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{ github.WORKSPACE }}\src\WinUEFI-setup.iss" | |
shell: cmd | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: WinUEFI | |
path: build/WinUEFI-setup.exe | |
build_disk_images: | |
name: Build disk images (.ISO and .IMG) | |
needs: [build_exe, build_installer] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: WinUEFI | |
path: build | |
- name: Copy setup | |
run: copy "${{ github.workspace }}\build\WinUEFI-setup.exe" "${{ github.workspace }}\src\ISO\autorun.exe" | |
shell: cmd | |
- name: Create .ISO disk image | |
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: '"${{ 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 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: WinUEFI | |
path: | | |
build/*.iso | |
build/*.img | |
build/*.mds | |
build/*.dvd | |
get_checksums_and_release: | |
name: Get file checksums | |
needs: [build_exe, build_installer, build_disk_images] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: WinUEFI | |
path: build | |
- name: Generate checksums | |
uses: jmgilman/actions-generate-checksum@v1 | |
with: | |
output: build/checksums.txt | |
patterns: | | |
build/*.exe | |
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 | |
- uses: marvinpinto/action-automatic-releases@latest | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
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 |