-
Notifications
You must be signed in to change notification settings - Fork 15
107 lines (92 loc) · 4.96 KB
/
artifcats.yaml
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
name: Artifacts
on:
push:
branches-ignore:
- main
tags:
- v*
defaults:
run:
shell: powershell
jobs:
release:
name: Make artifacts
runs-on: windows-2022
steps:
- name: Set Short Sha
run: |
echo "git_sha=$('${{github.sha}}'.Substring(0, 7))" >> $env:GITHUB_ENV
- name: Set Version Information - Main
if: ${{startsWith(github.ref, 'refs/tags/v')}}
run: |
echo "pbom_version=$('${{github.ref}}' -replace 'refs/tags/v','')" >> $env:GITHUB_ENV
echo "pbom_build_number=${{github.run_number}} (${{env.git_sha}})" >> $env:GITHUB_ENV
echo "pbom_installer_version=$('${{github.ref}}' -replace 'refs/tags/v','')" >> $env:GITHUB_ENV
echo "pbom_msix_version=$('${{github.ref}}.${{github.run_number}}' -replace 'refs/tags/v','')" >> $env:GITHUB_ENV
- name: Set Version Information - Branch
if: ${{startsWith(github.ref, 'refs/heads/')}}
run: |
echo "pbom_version=$('${{github.ref}}' -replace 'refs/heads/','' -replace '[^\w\d]','_')" >> $env:GITHUB_ENV
echo "pbom_build_number=${{github.run_number}} (${{env.git_sha}})" >> $env:GITHUB_ENV
echo "pbom_installer_version=0.0.${{github.run_number}}" >> $env:GITHUB_ENV
echo "pbom_msix_version=0.0.0.${{github.run_number}}" >> $env:GITHUB_ENV
- name: Install MSVC 2022
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: '6.6.1'
host: windows
target: desktop
arch: win64_msvc2019_64
dir: ${{github.workspace}}
tools: tools_opensslv3_x64
- name: Checkout
uses: actions/checkout@v4
with:
path: code
submodules: true
- name: CMake Cache
run: |
cmake -S ${{github.workspace}}\code\ -B ${{github.workspace}}\_build\ `
-G Ninja -DCMAKE_BUILD_TYPE=Release `
-DPBOM_BUILD_NUMBER:STRING="${{env.pbom_build_number}}" `
-DPBOM_VERSION:STRING="${{env.pbom_version}}"
- name: CMake Build
run: cmake --build ${{github.workspace}}\_build\
- name: CMake Install
run: |
cmake --install ${{github.workspace}}\_build\ --prefix "${{github.workspace}}\_install\"
mkdir ${{github.workspace}}\_artifacts\
cp -Path ${{github.workspace}}\_install\bin -Destination "${{github.workspace}}\_artifacts\" -Recurse
mv -Path ${{github.workspace}}\_artifacts\bin -Destination "${{github.workspace}}\_artifacts\PBO Manager"
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: PBOManager-binaries-${{env.pbom_version}}-${{env.pbom_build_number}}
path: ${{github.workspace}}\_artifacts\
- name: Build installer
run: |
$env:Path=$env:Path + ";C:\Program Files (x86)\WiX Toolset v3.11\bin"
candle.exe -dArtifactsFolder=${{github.workspace}}\_install\bin\ -dProductVersion="${{env.pbom_installer_version}}" -out ${{github.workspace}}\_artifacts\PBOManager.wixobj ${{github.workspace}}\code\installer\PBOManager.wxs
light.exe -ext WixUIExtension -dWixUILicenseRtf=${{github.workspace}}\code\LICENSE.rtf -out ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_installer_version}}.msi ${{github.workspace}}\_artifacts\PBOManager.wixobj
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: PBOManager-installer-${{env.pbom_version}}-${{env.pbom_build_number}}
path: ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_installer_version}}.msi
- name: Build MSIX package
run: |
$env:PATH = $env:PATH + ";C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64"
cp -Path ${{github.workspace}}\code\msix\package\ -Destination ${{github.workspace}}\_msix\ -Recurse
makepri.exe new /of ${{github.workspace}}\_msix\resources.pri /mn ${{github.workspace}}\code\msix\AppxManifest.xml /pr ${{github.workspace}}\_msix\ /cf ${{github.workspace}}\code\msix\priconfig.xml
(Get-Content ${{github.workspace}}\code\msix\AppxManifest.xml).Replace('Version="1.0.0.0"', 'Version="${{env.pbom_msix_version}}"') | Set-Content ${{github.workspace}}\_msix\AppxManifest.xml
cp -Path ${{github.workspace}}\_install\bin\* -Destination ${{github.workspace}}\_msix\ -Recurse
makeappx.exe pack /d ${{github.workspace}}\_msix\ /p ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_msix_version}}.msix
- name: Upload MSIX package
uses: actions/upload-artifact@v4
with:
name: PBOManager-msix-${{env.pbom_version}}-${{env.pbom_build_number}}
path: ${{github.workspace}}\_artifacts\PBOManager.${{env.pbom_msix_version}}.msix