Merge pull request #326 from Romanitho/dev

Version adjustments
pull/328/head
Romain 2023-04-22 13:12:50 +02:00 committed by GitHub
commit dd4bb1288d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View File

@ -3,7 +3,7 @@ name: WAU - Auto Create Pre-Release Version
on: on:
schedule: schedule:
- cron: '0 0 * * *' - cron: "0 0 * * *"
permissions: permissions:
contents: write contents: write
@ -49,7 +49,7 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
lfs: 'true' lfs: "true"
fetch-depth: 0 fetch-depth: 0
- name: Auto Increment Semver Action - name: Auto Increment Semver Action
@ -80,7 +80,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main branch: main
force: true force: true
message: 'Changed version to ${{ steps.versioning.outputs.version }}' message: "Changed version to ${{ steps.versioning.outputs.version }}"
- name: Build project - name: Build project
run: | run: |

View File

@ -6,7 +6,7 @@ on:
inputs: inputs:
version: version:
type: choice type: choice
default: 'Patch' default: "Patch"
description: Select next release type description: Select next release type
options: options:
- Patch - Patch
@ -28,7 +28,7 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
lfs: 'true' lfs: "true"
- name: Auto Increment Semver Action - name: Auto Increment Semver Action
uses: MCKanpolat/auto-semver-action@1.0.9 uses: MCKanpolat/auto-semver-action@1.0.9
@ -51,7 +51,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main branch: main
force: true force: true
message: 'Changed version to ${{ steps.versioning.outputs.version }}' message: "Changed version to ${{ steps.versioning.outputs.version }}"
- name: Build project - name: Build project
run: | run: |

View File

@ -94,7 +94,7 @@ if (Test-Network) {
#Get Available Version #Get Available Version
$Script:WAUAvailableVersion = Get-WAUAvailableVersion $Script:WAUAvailableVersion = Get-WAUAvailableVersion
#Compare #Compare
if ([version]$WAUAvailableVersion.Replace("-", ".") -ne [version]$WAUCurrentVersion) { if ([version]$WAUAvailableVersion.Replace("-", ".") -ne [version]$WAUCurrentVersion.Replace("-", ".")) {
#If new version is available, update it #If new version is available, update it
Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow" Write-ToLog "WAU Available version: $WAUAvailableVersion" "Yellow"
Update-WAU Update-WAU

View File

@ -45,9 +45,8 @@ function Invoke-PostUpdateActions {
Write-ToLog "-> Prerequisites checked. OK" "green" Write-ToLog "-> Prerequisites checked. OK" "green"
} }
Write-ToLog "-> Checking if Winget is installed/up to date" "yellow"
#Check Package Install #Check Package Install
Write-ToLog "-> Checking if Winget is installed/up to date" "yellow"
$TestWinGet = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq "Microsoft.DesktopAppInstaller" } $TestWinGet = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq "Microsoft.DesktopAppInstaller" }
#Current: v1.4.10173 = 1.19.10173.0 = 2023.118.406.0 #Current: v1.4.10173 = 1.19.10173.0 = 2023.118.406.0
@ -189,12 +188,13 @@ function Invoke-PostUpdateActions {
Write-ToLog "-> $WAUConfigPath converted." "green" Write-ToLog "-> $WAUConfigPath converted." "green"
} }
#Remove old functions #Remove old functions / files
$FileNames = @( $FileNames = @(
"$WorkingDir\functions\Get-WAUConfig.ps1", "$WorkingDir\functions\Get-WAUConfig.ps1",
"$WorkingDir\functions\Get-WAUCurrentVersion.ps1", "$WorkingDir\functions\Get-WAUCurrentVersion.ps1",
"$WorkingDir\functions\Get-WAUUpdateStatus.ps1", "$WorkingDir\functions\Get-WAUUpdateStatus.ps1",
"$WorkingDir\functions\Write-Log.ps1" "$WorkingDir\functions\Write-Log.ps1",
"$WorkingDir\Version.txt"
) )
foreach ($FileName in $FileNames) { foreach ($FileName in $FileNames) {
if (Test-Path $FileName) { if (Test-Path $FileName) {

View File

@ -23,25 +23,25 @@ function Update-WAU {
Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v$($WAUAvailableVersion)/WAU.zip" -OutFile $ZipFile Invoke-RestMethod -Uri "https://github.com/Romanitho/Winget-AutoUpdate/releases/download/v$($WAUAvailableVersion)/WAU.zip" -OutFile $ZipFile
#Extract Zip File #Extract Zip File
Write-ToLog "Unzipping the WAU GitHub Repository" "Cyan" Write-ToLog "Unzipping the WAU Update package" "Cyan"
$location = "$WorkingDir\WAU_update" $location = "$WorkingDir\WAU_update"
Expand-Archive -Path $ZipFile -DestinationPath $location -Force Expand-Archive -Path $ZipFile -DestinationPath $location -Force
Get-ChildItem -Path $location -Recurse | Unblock-File Get-ChildItem -Path $location -Recurse | Unblock-File
#Update scritps #Update scritps
Write-ToLog "Updating WAU" "Yellow" Write-ToLog "Updating WAU..." "Yellow"
$TempPath = (Resolve-Path "$location\Winget-AutoUpdate\")[0].Path $TempPath = (Resolve-Path "$location\Winget-AutoUpdate\")[0].Path
if ($TempPath) { if ($TempPath) {
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
} }
#Remove update zip file and update temp folder #Remove update zip file and update temp folder
Write-ToLog "Done. Cleaning temp files" "Cyan" Write-ToLog "Done. Cleaning temp files..." "Cyan"
Remove-Item -Path $ZipFile -Force -ErrorAction SilentlyContinue Remove-Item -Path $ZipFile -Force -ErrorAction SilentlyContinue
Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue Remove-Item -Path $location -Recurse -Force -ErrorAction SilentlyContinue
#Set new version to registry #Set new version to registry
$WAUConfig | New-ItemProperty -Name DisplayVersion -Value $($WAUAvailableVersion.Replace("-", ".")) -Force $WAUConfig | New-ItemProperty -Name DisplayVersion -Value $WAUAvailableVersion -Force
$WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Major -Force $WAUConfig | New-ItemProperty -Name VersionMajor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Major -Force
$WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Minor -Force $WAUConfig | New-ItemProperty -Name VersionMinor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Minor -Force