4
4
push :
5
5
branches :
6
6
- main
7
- - master
7
+ tags :
8
+ - v**
8
9
pull_request :
9
10
branches :
10
11
- main
20
21
build :
21
22
name : Build
22
23
runs-on : windows-2022
24
+ env :
25
+ WixOfficialBuild : ${{ github.repository_owner == 'wixtoolset' && startsWith(github.ref, 'refs/tags/v') }}
23
26
permissions :
24
27
packages : write
25
28
id-token : write
34
37
# run: ./src/vs_config.cmd
35
38
36
39
- name : Install sign tool
37
- if : (github.ref == 'refs/heads/master')
40
+ if : ${{ env.WixOfficialBuild == 'true' }}
38
41
shell : cmd
39
- run : dotnet tool install --tool-path build\.tools sign --version 0.9.1-beta.24529.1
42
+ run : dotnet tool install --tool-path build\.tools sign --version 0.9.1-beta.24170.3
40
43
41
44
- name : Configure automated logging and crash dumps
42
45
shell : cmd
51
54
reg add "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\Windows Error Reporting\LocalDumps" /t REG_DWORD /v DumpType /d 1
52
55
53
56
- name : ' Az CLI login'
54
- if : (github.ref == 'refs/heads/master')
57
+ if : ${{ env.WixOfficialBuild == 'true' }}
55
58
uses : azure/login@v1
56
59
with :
57
60
allow-no-subscriptions : true
@@ -63,11 +66,11 @@ jobs:
63
66
run : ./src/build_official.cmd
64
67
env :
65
68
RuntimeTestsEnabled : true
66
- SigningKeyVaultUri : ${{ github.ref == 'refs/heads/master ' && secrets.WIX_SIGNING_VAULTURI || '' }}
67
- SigningTenantId : ${{ github.ref == 'refs/heads/master ' && secrets.WIX_SIGNING_TENANTID || '' }}
68
- SigningClientId : ${{ github.ref == 'refs/heads/master ' && secrets.WIX_SIGNING_CLIENTID || '' }}
69
- SigningClientSecret : ${{ github.ref == 'refs/heads/master ' && secrets.WIX_SIGNING_SECRET || '' }}
70
- SigningCertName : ${{ github.ref == 'refs/heads/master ' && secrets.WIX_SIGNING_CERTNAME || '' }}
69
+ SigningKeyVaultUri : ${{ env.WixOfficialBuild == 'true ' && secrets.WIX_SIGNING_VAULTURI || '' }}
70
+ SigningTenantId : ${{ env.WixOfficialBuild == 'true ' && secrets.WIX_SIGNING_TENANTID || '' }}
71
+ SigningClientId : ${{ env.WixOfficialBuild == 'true ' && secrets.WIX_SIGNING_CLIENTID || '' }}
72
+ SigningClientSecret : ${{ env.WixOfficialBuild == 'true ' && secrets.WIX_SIGNING_SECRET || '' }}
73
+ SigningCertName : ${{ env.WixOfficialBuild == 'true ' && secrets.WIX_SIGNING_CERTNAME || '' }}
71
74
72
75
- name : Validate test results
73
76
shell : cmd
@@ -80,28 +83,28 @@ jobs:
80
83
path : build/artifacts/
81
84
82
85
- name : Collect integration test logs
83
- if : always()
86
+ if : ${{ !cancelled() }}
84
87
shell : cmd
85
88
run : 7z a "build\logs\test_burn_%GITHUB_RUN_ID%.zip" "%TEMP%\*.log" "%TEMP%\..\*.log"
86
89
87
90
- name : Export Application event log
88
- if : always()
91
+ if : ${{ !cancelled() }}
89
92
shell : cmd
90
93
run : wevtutil epl Application build\logs\Application.evtx /q:"Event/System/TimeCreated[timediff(@SystemTime) <= 86400000]"
91
94
92
95
- name : Export System event log
93
- if : always()
96
+ if : ${{ !cancelled() }}
94
97
shell : cmd
95
98
run : wevtutil epl System build\logs\System.evtx /q:"Event/System/TimeCreated[timediff(@SystemTime) <= 86400000]"
96
99
97
- # Do NOT publish logs on `master` branch as they may contain secrets in them.
100
+ # Do NOT publish logs on `official builds` (version tagged builds) as they may contain secrets in them.
98
101
- name : Save logs
99
- if : github.ref != 'refs/heads/master ' && always()
102
+ if : ${{ env.WixOfficialBuild != 'true ' && !cancelled() }}
100
103
uses : actions/upload-artifact@v4
101
104
with :
102
105
name : logs_${{ github.run_id }}
103
106
path : build/logs/
104
107
105
108
- name : Push to GitHub Packages
106
- if : github.event_name == 'push' && github.repository_owner == 'wixtoolset' && (github.ref == 'refs/heads/master ' || github.ref == 'refs/heads/main')
109
+ if : ${{ github.event_name == 'push' && github.repository_owner == 'wixtoolset' && (env.WixOfficialBuild == 'true ' || github.ref == 'refs/heads/main') }}
107
110
run : dotnet nuget push "build/artifacts/**/*.nupkg" --source https://nuget.pkg.github.com/wixtoolset/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
0 commit comments