Fix Update Package Versions step: use bash instead of CMD
The CMD approach failed because: 1. wmic is deprecated and not available on the Windows runner 2. PowerShell pipes inside CMD were misinterpreted Switch to bash which is now available on the Windows runner. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b046d12c09
commit
db61321e64
@ -131,30 +131,25 @@ jobs:
|
||||
echo Definitions and docs packaged
|
||||
|
||||
- name: Update Package Versions
|
||||
shell: cmd
|
||||
shell: bash
|
||||
run: |
|
||||
setlocal enabledelayedexpansion
|
||||
VERSION="$CLEAN_VERSION"
|
||||
CHANNEL="$CHANNEL"
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
|
||||
set "VERSION=%CLEAN_VERSION%"
|
||||
set "CHANNEL=%CHANNEL%"
|
||||
echo "Updating to version $VERSION for channel $CHANNEL on $TODAY"
|
||||
|
||||
REM Get today's date in YYYY-MM-DD format
|
||||
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set "DT=%%I"
|
||||
set "TODAY=!DT:~0,4!-!DT:~4,2!-!DT:~6,2!"
|
||||
# Update package.xml files
|
||||
find installer/packages -name "package.xml" | while read f; do
|
||||
sed -i "s|<Version>.*</Version>|<Version>$VERSION</Version>|g" "$f"
|
||||
sed -i "s|<ReleaseDate>.*</ReleaseDate>|<ReleaseDate>$TODAY</ReleaseDate>|g" "$f"
|
||||
done
|
||||
|
||||
echo Updating to version !VERSION! for channel !CHANNEL! on !TODAY!
|
||||
# Update config.xml
|
||||
sed -i "s|<Version>.*</Version>|<Version>$VERSION</Version>|g" installer/config/config.xml
|
||||
sed -i "s|repository/[^<\"]*|repository/$CHANNEL|g" installer/config/config.xml
|
||||
|
||||
REM Update package.xml files using PowerShell for regex
|
||||
for /r installer\packages %%f in (package.xml) do (
|
||||
if exist "%%f" (
|
||||
powershell -Command "(Get-Content '%%f') -replace '<Version>.*</Version>', '<Version>%VERSION%</Version>' -replace '<ReleaseDate>.*</ReleaseDate>', '<ReleaseDate>%TODAY%</ReleaseDate>' | Set-Content '%%f'"
|
||||
)
|
||||
)
|
||||
|
||||
REM Update config.xml
|
||||
powershell -Command "(Get-Content 'installer\config\config.xml') -replace '<Version>.*</Version>', '<Version>%VERSION%</Version>' -replace 'repository/[^<\"]*', 'repository/%CHANNEL%' | Set-Content 'installer\config\config.xml'"
|
||||
|
||||
echo Updated versions to !VERSION! for channel !CHANNEL!
|
||||
echo "Updated versions to $VERSION for channel $CHANNEL"
|
||||
|
||||
- name: Generate Repository
|
||||
shell: cmd
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user