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

View File

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

View File

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

View File

@ -45,9 +45,8 @@ function Invoke-PostUpdateActions {
Write-ToLog "-> Prerequisites checked. OK" "green"
}
Write-ToLog "-> Checking if Winget is installed/up to date" "yellow"
#Check Package Install
Write-ToLog "-> Checking if Winget is installed/up to date" "yellow"
$TestWinGet = Get-AppxProvisionedPackage -Online | Where-Object { $_.DisplayName -eq "Microsoft.DesktopAppInstaller" }
#Current: v1.4.10173 = 1.19.10173.0 = 2023.118.406.0
@ -189,12 +188,13 @@ function Invoke-PostUpdateActions {
Write-ToLog "-> $WAUConfigPath converted." "green"
}
#Remove old functions
#Remove old functions / files
$FileNames = @(
"$WorkingDir\functions\Get-WAUConfig.ps1",
"$WorkingDir\functions\Get-WAUCurrentVersion.ps1",
"$WorkingDir\functions\Get-WAUUpdateStatus.ps1",
"$WorkingDir\functions\Write-Log.ps1"
"$WorkingDir\functions\Write-Log.ps1",
"$WorkingDir\Version.txt"
)
foreach ($FileName in $FileNames) {
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
#Extract Zip File
Write-ToLog "Unzipping the WAU GitHub Repository" "Cyan"
Write-ToLog "Unzipping the WAU Update package" "Cyan"
$location = "$WorkingDir\WAU_update"
Expand-Archive -Path $ZipFile -DestinationPath $location -Force
Get-ChildItem -Path $location -Recurse | Unblock-File
#Update scritps
Write-ToLog "Updating WAU" "Yellow"
Write-ToLog "Updating WAU..." "Yellow"
$TempPath = (Resolve-Path "$location\Winget-AutoUpdate\")[0].Path
if ($TempPath) {
Copy-Item -Path "$TempPath\*" -Destination "$WorkingDir\" -Exclude "icons" -Recurse -Force
}
#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 $location -Recurse -Force -ErrorAction SilentlyContinue
#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 VersionMinor -Value ([version]$WAUAvailableVersion.Replace("-", ".")).Minor -Force