Skip to content

Commit

Permalink
Merge pull request #170 from aaronparker/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
aaronparker authored Jul 25, 2024
2 parents 7328e03 + accdfd4 commit de29ab9
Show file tree
Hide file tree
Showing 19 changed files with 539 additions and 371 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/update-manifest-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Update module manifest for ARM64

on:
workflow_dispatch:
# push:
# branches: [ development ]
# paths:
# - ci/Update-ManifestArm.ps1
# schedule:
# - cron: '1 18 * * *'

env:
MANIFEST_FILE: ${{ github.workspace }}\VcRedist\VisualCRedistributables.json

jobs:
validate-versions:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
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: |
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 = @{
Path = "$env:RUNNER_TEMP\VcRedist"
VcManifest = "${{ env.MANIFEST_FILE }}"
}
. ${{ github.workspace }}\ci\Update-ManifestArm.ps1 @params
# Format the date number for the commit message
- name: Get date
id: get-date
shell: powershell
run: |
echo "::set-output name=date::$(Get-Date -Format "yyyy-MM-dd")"
# Commit changes to the manifest
- name: Commit changes
id: commit
uses: stefanzweifel/git-auto-commit-action@v5
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."
2 changes: 1 addition & 1 deletion .github/workflows/validate-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
# Publish Pester test results
- name: Publish Pester test results
uses: EnricoMi/publish-unit-test-result-action/composite@v2
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
nunit_files: "${{ github.workspace }}//tests//TestResults-${{ matrix.os }}.xml"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ codecov.exe
.cache
CodeCoverage*.xml
TestResults*.xml
enricomi-publish-action-venv
2 changes: 1 addition & 1 deletion VcRedist/Private/New-MdtDrive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function New-MdtDrive {
Description = $Description
ErrorAction = "Stop"
}
New-PSDrive @params | Add-MDTPersistentDrive
New-PSDrive @params | Add-MDTPersistentDrive | Out-Null

# Return the MDT drive name
$psDrive = Get-MdtPersistentDrive | Where-Object { $_.Path -eq $Path -and $_.Name -eq $Drive }
Expand Down
4 changes: 2 additions & 2 deletions VcRedist/Public/Get-VcList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Get-VcList {
[System.String[]] $Release = @("2012", "2013", "2022"),

[Parameter(Mandatory = $false, Position = 1, ParameterSetName = "Manifest")]
[ValidateSet("x86", "x64")]
[ValidateSet("x86", "x64", "ARM64")]
[System.String[]] $Architecture = @("x86", "x64"),

[Parameter(Mandatory = $false, Position = 2, ValueFromPipeline, ParameterSetName = "Manifest")]
Expand Down Expand Up @@ -70,7 +70,7 @@ function Get-VcList {
# if ($Release -match $JsonManifest.Unsupported.Release) {
# Write-Warning -Message "This list includes unsupported Visual C++ Redistributables."
# }
[System.Management.Automation.PSObject] $Output = $JsonManifest.Supported | Where-Object { $Release -contains $_.Release } | `
[System.Management.Automation.PSObject]$Output = $JsonManifest.Supported | Where-Object { $Release -contains $_.Release } | `
Where-Object { $Architecture -contains $_.Architecture }
}

Expand Down
2 changes: 1 addition & 1 deletion VcRedist/Public/Uninstall-VcRedist.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Uninstall-VcRedist {
[System.String[]] $Release = @("2005", "2008", "2010", "2012", "2013", "2015", "2017", "2019", "2022"),

[Parameter(Mandatory = $false, Position = 1, ParameterSetName = "Manual")]
[ValidateSet("x86", "x64")]
[ValidateSet("x86", "x64", "ARM64")]
[System.String[]] $Architecture = @("x86", "x64"),

[Parameter(
Expand Down
4 changes: 2 additions & 2 deletions VcRedist/VcRedist.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Module manifest for module 'VcRedist'
#
# Generated by: Aaron Parker
Expand All @@ -12,7 +12,7 @@
RootModule = 'VcRedist.psm1'

# Version number of this module.
ModuleVersion = '4.1.497'
ModuleVersion = '4.1.499'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading

0 comments on commit de29ab9

Please sign in to comment.