mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
convert version bump to use pwsh
This commit is contained in:
parent
cc466cb0f4
commit
f14d1f3c5c
1 changed files with 14 additions and 13 deletions
27
.github/workflows/nightly-release.yml
vendored
27
.github/workflows/nightly-release.yml
vendored
|
|
@ -26,30 +26,31 @@ jobs:
|
|||
run: pnpm install
|
||||
|
||||
- name: Bump version and add beta suffix
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Get current version from package.json
|
||||
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||
echo "Current version: $CURRENT_VERSION"
|
||||
$currentVersion = (Get-Content package.json | ConvertFrom-Json).version
|
||||
Write-Host "Current version: $currentVersion"
|
||||
|
||||
# Extract major, minor, patch components
|
||||
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
|
||||
$versionParts = $currentVersion.Split('.')
|
||||
$major = [int]$versionParts[0]
|
||||
$minor = [int]$versionParts[1]
|
||||
$patch = [int]$versionParts[2]
|
||||
|
||||
# Increment patch version
|
||||
NEW_PATCH=$((PATCH + 1))
|
||||
$newPatch = $patch + 1
|
||||
|
||||
# Create new version with beta suffix
|
||||
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}-beta"
|
||||
echo "New version: $NEW_VERSION"
|
||||
$newVersion = "$major.$minor.$newPatch-beta"
|
||||
Write-Host "New version: $newVersion"
|
||||
|
||||
# Update package.json
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
||||
pkg.version = '$NEW_VERSION';
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 4) + '\n');
|
||||
"
|
||||
$packageJson = Get-Content package.json | ConvertFrom-Json
|
||||
$packageJson.version = $newVersion
|
||||
$packageJson | ConvertTo-Json -Depth 10 | Set-Content package.json
|
||||
|
||||
echo "Updated package.json version to: $NEW_VERSION"
|
||||
Write-Host "Updated package.json version to: $newVersion"
|
||||
|
||||
# - name: Build and Publish releases (Windows)
|
||||
# if: matrix.os == 'windows-latest'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue