Inno Setup version fix #164
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 | |
outputs: | |
version: ${{ steps.set_version_branch.outputs.version || steps.set_version_tag.outputs.version || steps.set_version_pr.outputs.version || steps.set_version_manual.outputs.version }} | |
steps: | |
- name: Set VERSION for branch | |
id: set_version_branch | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') | |
run: echo "::set-output name=version::${{ github.sha }}" | |
- name: Set VERSION for tag | |
id: set_version_tag | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
run: echo "::set-output name=version::${{ github.ref_name }}" | |
- name: Set VERSION for pull request | |
id: set_version_pr | |
if: github.event_name == 'pull_request' | |
run: echo "::set-output name=version::${{ github.sha }}" | |
- name: Set VERSION for manual dispatch | |
id: set_version_manual | |
if: github.event_name == 'workflow_dispatch' | |
run: echo "::set-output name=version::${{ github.sha }}" | |
build_exe: | |
name: Build EXE | |
runs-on: windows-latest | |
needs: set_version | |
strategy: | |
matrix: | |
config: | |
- { arch: amd64, arch_name: x64, arch_name_full: "64-bit" } | |
- { arch: i386, arch_name: x86, arch_name_full: "32-bit" } | |
env: | |
VERSION: ${{ needs.set_version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 "${{ env.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 "${{ env.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: [set_version, build_exe] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: [set_version, build_exe, build_installer] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: [set_version, build_exe, build_installer, build_disk_images] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 ${{ needs.set_version.outputs.version }}" | |
files: | | |
build/*.txt | |
build/*.exe | |
build/*.iso | |
build/*.img | |
build/*.mds | |
build/*.dvd | |
src/*.bat | |
src/*.ps1 | |
src/*.py | |