diff --git a/.github/update-registry.ps1 b/.github/update-registry.ps1 index 291010c4..31cc3b8f 100644 --- a/.github/update-registry.ps1 +++ b/.github/update-registry.ps1 @@ -1,4 +1,4 @@ -#Requires -Version 5 +#Requires -Version 7.1 # args param ( @@ -7,7 +7,7 @@ param ( # test-path if (!(Test-Path "$PathIn/CommonLibSF") -or !(Test-Path "$PathIn/CommonLibSF/vcpkg.json") -or !(Test-Path "$PathIn/README.md")) { - Write-Output "::set-output name=VCPKG_SUCCESS::false" + Write-Output "VCPKG_SUCCESS=false" >> $env:GITHUB_OUTPUT exit } @@ -16,6 +16,19 @@ $version = (Get-Date -AsUTC -Format "yyyy-MM-dd") # update vcpkg $vcpkg = [IO.File]::ReadAllText("$PathIn/CommonLibSF/vcpkg.json") | ConvertFrom-Json + +$currVersion = $vcpkg.'version-date' + +if($currVersion.Contains($version)) { + $version = if ($currVersion.Contains('.')) { + $identifiers = $currVersion.Split('.') + "$($identifiers[0]).$([Int32]$identifiers[1] + 1)" + } + else { + "$($currVersion).1" + } +} + $vcpkg.'version-date' = $version $vcpkg = $vcpkg | ConvertTo-Json -Depth 9 | ForEach-Object { $_ -replace "(?m) (?<=^(?: )*)", " " } [IO.File]::WriteAllText("$PathIn/CommonLibSF/vcpkg.json", $vcpkg) @@ -26,5 +39,5 @@ $readme = $readme -replace "(?<=label=vcpkg%20registry&message=).+?(?=&color)", [IO.File]::WriteAllLines("$PathIn/README.md", $readme) # status -Write-Output "::set-output name=VCPKG_SUCCESS::true" -Write-Output "::set-output name=VCPKG_VERSION::$version" +Write-Output "VCPKG_SUCCESS=true" >> $env:GITHUB_OUTPUT +Write-Output "VCPKG_VERSION=$version" >> $env:GITHUB_OUTPUT diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index c41a37d4..24ec0b5f 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -39,10 +39,9 @@ jobs: - name: Check for Commit uses: EndBug/add-and-commit@v9 with: - author_name: maintenance + committer_name: maintenance + committer_email: 41898282+github-actions[bot]@users.noreply.github.com message: "ci: maintenance `${{ steps.versioning.outputs.VCPKG_VERSION }}`" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Repository Dispatch uses: peter-evans/repository-dispatch@v2 @@ -50,3 +49,4 @@ jobs: token: ${{ secrets.VCPKG_HELPER_TOKEN }} repository: ${{ github.repository_owner }}/Starfield-RE-vcpkg event-type: update-event + client-payload: '{"sha": "${{ github.sha }}", "vcpkg-version": "${{ steps.versioning.outputs.VCPKG_VERSION }}"}'