Skip to content

Commit

Permalink
Revert last 9 commits, on updating https://rime.github.io/testing/wea…
Browse files Browse the repository at this point in the history
  • Loading branch information
fxliang committed Jul 26, 2024
1 parent 3a52f38 commit 6d0be22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 93 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,38 +104,4 @@ jobs:
./output/archives/weasel*.exe
./output/archives/debug_symbols.7z
body_path: ${{ github.workspace }}/RELEASE_CHANGELOG.md

- name: Generate testing/weasel/appcast.xml
run: |
.\build.bat appcast
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: testing\weasel\appcast.xml

update_appcast:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-and-release]
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: testing/weasel
merge-multiple: true

- run: ls -R testing/weasel

- name: Deploy appcast
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: rime/rime.github.io
publish_dir: ./testing/weasel/
destination_dir: 'testing/weasel'
keep_files: true
publish_branch: master
cname: rime.im

58 changes: 0 additions & 58 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ set rime_build_variant=release
set build_weasel=0
set build_installer=0
set build_arm64=0
set build_appcast=0

rem parse the command line options
:parse_cmdline_options
Expand All @@ -93,7 +92,6 @@ rem parse the command line options
if "%1" == "weasel" set build_weasel=1
if "%1" == "installer" set build_installer=1
if "%1" == "arm64" set build_arm64=1
if "%1" == "appcast" set build_appcast=1
if "%1" == "all" (
set build_boost=1
set build_data=1
Expand All @@ -107,11 +105,6 @@ rem parse the command line options
goto parse_cmdline_options
:end_parsing_cmdline_options

if %build_appcast% == 1 (
call :build_appcast_xml
exit /b
)

if %build_weasel% == 0 (
if %build_boost% == 0 (
if %build_data% == 0 (
Expand Down Expand Up @@ -362,57 +355,6 @@ rem %3 : target_path of rime.dll, base %WEASEL_ROOT% or abs path
if errorlevel 1 goto error

exit /b

:build_appcast_xml
echo generating testing/weasel/appcast.xml
if not exist testing\weasel (mkdir testing\weasel)
copy update\testing-appcast.xml testing\weasel\appcast.xml > nul
if exist update_cast.ps1 del update_cast.ps1 > nul
echo $content = Get-Content -Path ^
.\testing\weasel\appcast.xml -Raw -Encoding UTF8 > update_cast.ps1
rem set url for nightly build or public release, by %RELEASE_BUILD%
echo $short_pat = "\d+\.\d+\.\d+" >> update_cast.ps1
echo $long_pat = "\d+\.\d+\.\d+\.\d+" >> update_cast.ps1
if not defined RELEASE_BUILD (
echo $newcontent = $content -replace "(?<=download/)$short_pat(?=/weasel-)", ^
"latest" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=weasel-)$long_pat(?=-installer.exe)", ^
"$env:PRODUCT_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=<title>\S+\s+)$short_pat(?=</title>)", ^
"$env:PRODUCT_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=sparkle:version=.)$short_pat", ^
"$env:PRODUCT_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace ^
"(?<=<sparkle:releaseNotesLink>)(http.*html)(?=</sparkle:releaseNotesLink>)", ^
"https://github.com/rime/weasel/releases/tag/latest" >> update_cast.ps1
) else (
echo $newcontent = $content -replace "(?<=download/)$short_pat(?=/weasel-)", ^
"$env:WEASEL_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=weasel-)$long_pat(?=-installer.exe)", ^
"$env:PRODUCT_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=<title>\S+\s+)$short_pat(?=</title>)", ^
"$env:WEASEL_VERSION" >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=sparkle:version=.)$short_pat", ^
"$env:WEASEL_VERSION" >> update_cast.ps1
)
rem save current set
echo $originalCulture = [System.Threading.Thread]::CurrentThread.CurrentCulture >> update_cast.ps1
echo $originalUICulture = [System.Threading.Thread]::CurrentThread.CurrentUICulture >> update_cast.ps1
echo [System.Threading.Thread]::CurrentThread.CurrentCulture = 'en-US' >> update_cast.ps1
echo [System.Threading.Thread]::CurrentThread.CurrentUICulture = 'en-US' >> update_cast.ps1
echo $dateString = Get-Date -Format "ddd, dd MMM yyyy HH:mm:ss K" >> update_cast.ps1
rem recover current set
echo [System.Threading.Thread]::CurrentThread.CurrentCulture = $originalCulture >> update_cast.ps1
echo [System.Threading.Thread]::CurrentThread.CurrentUICulture = $originalUICulture >> update_cast.ps1
echo $newcontent = $newcontent -replace "(?<=<pubDate>).*(?=</pubDate>)", "$dateString" >> update_cast.ps1
echo $newcontent ^| Set-Content -Path testing\weasel\appcast.xml -Encoding UTF8 >> update_cast.ps1
powershell.exe -ExecutionPolicy Bypass .\update_cast.ps1
if errorlevel 1 exit /b 1
del update_cast.ps1
if errorlevel 1 exit /b 1
echo generated testing/weasel/appcast.xml
exit /b

rem ---------------------------------------------------------------------------

:error
Expand Down

0 comments on commit 6d0be22

Please sign in to comment.