From 4cf0d0c1a613c95799ea7a01439bd278817563f9 Mon Sep 17 00:00:00 2001 From: "Randolph W. Aarseth II" Date: Wed, 18 Dec 2024 20:14:49 -0700 Subject: [PATCH] i forgot i didn't modify the package.json also trying to make verison appear in release job --- .github/workflows/build-release.yaml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index c406d07..486bcd4 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -78,7 +78,7 @@ jobs: needs: get-latest-sha runs-on: windows-latest outputs: - version: ${{ needs.get-latest-sha.outputs.version_string }} + version: ${{ steps.update_version.outputs.version }} steps: - name: Checkout repository uses: actions/checkout@v3 @@ -96,6 +96,31 @@ jobs: cd .\anko\ npm install + + - name: Update Package Version + id: update_version + run: | + # Ensure the working directory is correct + Set-Location -Path "${{ github.workspace }}" + + # Load the package.json file + $packageJsonPath = "./anko/package.json" + if (-Not (Test-Path -Path $packageJsonPath)) { + Write-Error "package.json not found at $packageJsonPath." + exit 1 + } + + # Update the version field + $packageJson = Get-Content -Raw -Path $packageJsonPath | ConvertFrom-Json + $packageJson.version = "${{ needs.get-latest-sha.outputs.version_string }}" + + # Save the updated package.json + $packageJson | ConvertTo-Json -Depth 10 | Set-Content -Path $packageJsonPath -Encoding utf8 + + # Log the update + Write-Host "Updated version to $($packageJson.version) in package.json." + echo "version=${{ needs.get-latest-sha.outputs.version_string }}" >> $ENV:GITHUB_OUTPUT + - name: Build VSIX file run: | cd .\anko\