Skip to content

Commit

Permalink
Merge pull request #44 from FreakinSoftMania/dev
Browse files Browse the repository at this point in the history
Workflow version fix
  • Loading branch information
Minionguyjpro authored Oct 12, 2024
2 parents 60d8a24 + 3a7b86b commit 56ce1ad
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,65 @@ 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 "VERSION=${{ github.sha }}" >> $GITHUB_ENV
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 "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
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 "VERSION=${{ github.sha }}" >> $GITHUB_ENV
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 "VERSION=${{ github.sha }}" >> $GITHUB_ENV
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@v3
- 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 "%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 }}"
"${{ 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
uses: actions/upload-artifact@v4
with:
name: WinUEFI
path: build/*.exe

build_installer:
name: Build installer
needs: build_exe
needs: [set_version, build_exe]
runs-on: windows-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name : Make build directory
run: mkdir build
Expand All @@ -79,22 +85,21 @@ jobs:

- name: Build the EXE installer
run: |
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{ github.WORKSPACE }}\src\WinUEFI-setup.iss"
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "${{ github.workspace }}\src\WinUEFI-setup.iss"
shell: cmd

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: WinUEFI
path: build/WinUEFI-setup.exe

build_disk_images:
name: Build disk images (.ISO and .IMG)
needs: [build_exe, build_installer]
needs: [set_version, build_exe, build_installer]
runs-on: windows-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v3
Expand All @@ -115,7 +120,7 @@ jobs:
shell: cmd

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: WinUEFI
path: |
Expand All @@ -126,11 +131,10 @@ jobs:
get_checksums_and_release:
name: Get file checksums
needs: [build_exe, build_installer, build_disk_images]
needs: [set_version, build_exe, build_installer, build_disk_images]
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v3
Expand All @@ -153,7 +157,7 @@ jobs:
src/*.py
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: WinUEFI
path: build/checksums.txt
Expand All @@ -163,7 +167,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
prerelease: false
title: "WinUEFI ${{ env.VERSION }}"
title: "WinUEFI ${{ needs.set_version.outputs.version }}"
files: |
build/*.txt
build/*.exe
Expand All @@ -174,3 +178,4 @@ jobs:
src/*.bat
src/*.ps1
src/*.py

0 comments on commit 56ce1ad

Please sign in to comment.