-
-
Notifications
You must be signed in to change notification settings - Fork 24
187 lines (165 loc) · 6.8 KB
/
Copy pathupdate-manifest.yml
File metadata and controls
187 lines (165 loc) · 6.8 KB
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
183
184
185
186
187
name: Update module manifest
on:
workflow_dispatch:
push:
branches: [ development ]
paths:
- ci/Update-Manifest.ps1
schedule:
- cron: '0 18 * * *'
env:
MANIFEST_FILE: ${{ github.workspace }}\VcRedist\VisualCRedistributables.json
jobs:
validate-amd64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
with:
ref: development
token: ${{ secrets.GITHUB_TOKEN }}
# Import GPG key so that we can sign the commit
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPGKEY }}
passphrase: ${{ secrets.GPGPASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
git_tag_gpgsign: true
git_push_gpgsign: false
git_committer_name: ${{ secrets.COMMIT_NAME }}
git_committer_email: ${{ secrets.COMMIT_EMAIL }}
# Uninstall existing VcRedists
- name: Uninstall VcRedists
shell: powershell
run: |
Import-Module ${{ github.workspace }}\VcRedist -Force
Get-InstalledVcRedist | Uninstall-VcRedist -Confirm:$False -Verbose
# Validate VcRedist 2017 and update the manifest
- name: Validate VcRedist 2017
shell: powershell
run: |
$Release = "2017"
Import-Module "${{ github.workspace }}\VcRedist" -Force
New-Item -Path "$env:RUNNER_TEMP\VcRedist" -ItemType "Directory" -ErrorAction "SilentlyContinue" | Out-Null
Get-VcList -Release $Release | Save-VcRedist -Path "$env:RUNNER_TEMP\VcRedist" | Install-VcRedist
$params = @{
Release = $Release
Path = "$env:RUNNER_TEMP\VcRedist"
VcManifest = "${{ env.MANIFEST_FILE }}"
}
. ${{ github.workspace }}\ci\Update-Manifest.ps1 @params
# Validate VcRedist 2019 and update the manifest
- name: Validate VcRedist 2019
shell: powershell
run: |
$Release = "2019"
Import-Module "${{ github.workspace }}\VcRedist" -Force
New-Item -Path "$env:RUNNER_TEMP\VcRedist" -ItemType "Directory" -ErrorAction "SilentlyContinue" | Out-Null
Get-VcList -Release $Release | Save-VcRedist -Path "$env:RUNNER_TEMP\VcRedist" | Install-VcRedist
$params = @{
Release = $Release
Path = "$env:RUNNER_TEMP\VcRedist"
VcManifest = "${{ env.MANIFEST_FILE }}"
}
. ${{ github.workspace }}\ci\Update-Manifest.ps1 @params
# Validate VcRedist 2022 and update the manifest
- name: Validate VcRedist 2022
shell: powershell
run: |
$Release = "2022"
Import-Module "${{ github.workspace }}\VcRedist" -Force
New-Item -Path "$env:RUNNER_TEMP\VcRedist" -ItemType "Directory" -ErrorAction "SilentlyContinue" | Out-Null
Get-VcList -Release $Release | Save-VcRedist -Path "$env:RUNNER_TEMP\VcRedist" | Install-VcRedist
$params = @{
Release = $Release
Path = "$env:RUNNER_TEMP\VcRedist"
VcManifest = "${{ env.MANIFEST_FILE }}"
}
. ${{ github.workspace }}\ci\Update-Manifest.ps1 @params
# Format the date number for the commit message
- name: Get date
id: get-date
shell: powershell
run: |
echo "date=$(Get-Date -Format "yyyy-MM-dd")" >> $GITHUB_STATE
# Commit changes to the manifest
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update manifest ${{ steps.get-date.outputs.date }}.${{ github.run_number }}"
commit_user_name: ${{ secrets.COMMIT_NAME }}
commit_user_email: ${{ secrets.COMMIT_EMAIL }}
- name: "Run if changes have been detected"
if: steps.commit.outputs.changes_detected == 'true'
run: echo "Changes committed."
- name: "Run if no changes have been detected"
if: steps.commit.outputs.changes_detected == 'false'
run: echo "No changes detected."
validate-arm64:
runs-on: windows-11-arm
needs: validate-amd64
steps:
- uses: actions/checkout@v5
with:
ref: development
token: ${{ secrets.GITHUB_TOKEN }}
# Import GPG key so that we can sign the commit
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPGKEY }}
passphrase: ${{ secrets.GPGPASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_config_global: true
git_tag_gpgsign: true
git_push_gpgsign: false
git_committer_name: ${{ secrets.COMMIT_NAME }}
git_committer_email: ${{ secrets.COMMIT_EMAIL }}
# Uninstall existing VcRedists
- name: Uninstall VcRedists
shell: powershell
run: |
Import-Module ${{ github.workspace }}\VcRedist -Force
Get-InstalledVcRedist | Uninstall-VcRedist -Confirm:$False -Verbose
# Validate VcRedist 2022 and update the manifest
- name: Validate VcRedist 2022
shell: powershell
run: |
$Release = "2022"
$Architecture = "arm64"
Import-Module "${{ github.workspace }}\VcRedist" -Force
New-Item -Path "$env:RUNNER_TEMP\VcRedist" -ItemType "Directory" -ErrorAction "SilentlyContinue" | Out-Null
Get-VcList -Release $Release -Architecture $Architecture | Save-VcRedist -Path "$env:RUNNER_TEMP\VcRedist" | Install-VcRedist
$params = @{
Release = $Release
Architecture = $Architecture
Path = "$env:RUNNER_TEMP\VcRedist"
VcManifest = "${{ env.MANIFEST_FILE }}"
}
. ${{ github.workspace }}\ci\Update-Manifest.ps1 @params
# Format the date number for the commit message
- name: Get date
id: get-date
shell: powershell
run: |
echo "date=$(Get-Date -Format "yyyy-MM-dd")" >> $GITHUB_STATE
# Commit changes to the manifest
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "Update manifest ARM64 ${{ steps.get-date.outputs.date }}.${{ github.run_number }}"
commit_user_name: ${{ secrets.COMMIT_NAME }}
commit_user_email: ${{ secrets.COMMIT_EMAIL }}
- name: "Run if changes have been detected"
if: steps.commit.outputs.changes_detected == 'true'
run: echo "Changes committed."
- name: "Run if no changes have been detected"
if: steps.commit.outputs.changes_detected == 'false'
run: echo "No changes detected."