-
Notifications
You must be signed in to change notification settings - Fork 2
182 lines (155 loc) · 6.43 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# 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: |
set VERSION=${{ needs.set_version.outputs.version }}
"%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