Skip to content

Commit

Permalink
i forgot i didn't modify the package.json also trying to make verison…
Browse files Browse the repository at this point in the history
… appear in release job
  • Loading branch information
Bioblaze committed Dec 19, 2024
1 parent 5c1231a commit 4cf0d0c
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\
Expand Down

0 comments on commit 4cf0d0c

Please sign in to comment.