Skip to content

fix: retrieve latest prerelease version in LatestBranch component #25

fix: retrieve latest prerelease version in LatestBranch component

fix: retrieve latest prerelease version in LatestBranch component #25

name: Rolling Release - Alpha
on:
push:
branches: [refactor-profiles]
paths:
- "frontend/**"
workflow_dispatch:
jobs:
Build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: refactor-profiles
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
cache: "pnpm"
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: cd frontend && pnpm install
- name: Build Frontend
run: cd frontend && pnpm build-only
- name: Create a compressed file
run: |
git rev-parse --short HEAD | tr -d '\n' > frontend/dist/version.txt
cd frontend
mv dist rolling-release
zip -r rolling-release.zip rolling-release
- name: Generate Changelog
run: |
set +e
LAST_COMMIT=$(curl -L https://github.com/GUI-for-Cores/GUI.for.SingBox/releases/download/rolling-release-alpha/version.txt)
echo -e "## Change log\n\n> Update time: $(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")\n" > changelog.md
git log $LAST_COMMIT..HEAD --pretty=format:"* %s" >> changelog.md
if [ $? -ne 0 ]; then
echo "No changes found since last commit." >> changelog.md
fi
echo -e "\n" >> changelog.md
echo -e "- 重写了配置界面\n" >> changelog.md
echo -e "- 配置界面完全遵循 sing-box 配置文件格式\n" >> changelog.md
echo -e "- 现在开始,以 sing-box 的方式使用 GUI!\n" >> changelog.md
echo -e "此版本为内测版,使用前请先备份并移除\`data/profiles.yaml\`文件,全新使用。\n" >> changelog.md
echo -e "若要恢复到稳定版,请执行【滚动发行插件】,并恢复原有的\`data/profiles.yaml\`文件\n" >> changelog.md
set -e
- name: Create Release and Upload Assets
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./{frontend/{rolling-release.zip,rolling-release/version.txt},changelog.md}
file_glob: true
tag: rolling-release-alpha
release_name: rolling-release-alpha
overwrite: true
draft: false
prerelease: true
body: |
Rolling release built by GitHub Actions.
To use this version, please install the "Rolling Release Assistant" plugin and enable "Enable Rolling Release" within the app.