clash-verge-rev/.github/workflows/alpha.yml

291 lines
9.6 KiB
YAML
Raw Normal View History

2024-02-15 18:45:13 +08:00
name: Alpha Build
2024-02-15 18:43:20 +08:00
on:
workflow_dispatch:
push:
2024-02-15 19:13:17 +08:00
branches: [main]
2024-02-15 19:45:37 +08:00
tags-ignore: [updater, alpha]
2024-02-15 18:43:20 +08:00
permissions: write-all
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: short
jobs:
alpha:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
2024-05-06 13:03:52 +08:00
- os: windows-latest
target: i686-pc-windows-msvc
2024-02-15 18:43:20 +08:00
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust Stable
2024-05-23 11:47:01 +08:00
uses: dtolnay/rust-toolchain@1.77.0
2024-02-15 18:43:20 +08:00
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v3
2024-02-15 18:43:20 +08:00
name: Install pnpm
with:
2024-04-17 21:48:07 +08:00
version: 9
2024-02-15 18:43:20 +08:00
run_install: false
- name: Pnpm install and check
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: Tauri build
uses: tauri-apps/tauri-action@v0
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
2024-02-15 18:43:20 +08:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
2024-06-06 15:21:53 +08:00
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
2024-02-15 18:43:20 +08:00
with:
tagName: alpha
releaseName: "Clash Verge Rev Alpha"
releaseBody: "More new features are now supported."
releaseDraft: false
prerelease: true
2024-06-04 10:47:17 +08:00
tauriScript: pnpm
2024-02-15 18:43:20 +08:00
args: --target ${{ matrix.target }}
- name: Portable Bundle
if: matrix.os == 'windows-latest'
run: pnpm portable ${{ matrix.target }} --alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
alpha-for-linux:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
2024-05-06 13:03:52 +08:00
- os: ubuntu-latest
target: i686-unknown-linux-gnu
2024-02-15 18:43:20 +08:00
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
2024-03-15 21:14:05 +08:00
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
2024-02-15 18:43:20 +08:00
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build for Linux
uses: ./.github/build-for-linux
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
2024-02-15 18:43:20 +08:00
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
target: ${{ matrix.target }}
2024-03-15 21:14:05 +08:00
2024-02-15 18:43:20 +08:00
- name: Get Version
run: |
sudo apt-get update
sudo apt-get install jq
echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
2024-03-15 21:52:56 +08:00
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
2024-02-15 18:43:20 +08:00
- name: Upload Release
if: startsWith(matrix.target, 'x86_64')
2024-05-06 15:30:00 +08:00
uses: softprops/action-gh-release@v2
2024-02-15 18:43:20 +08:00
with:
tag_name: alpha
name: "Clash Verge Rev Alpha"
body: "More new features are now supported."
2024-02-15 18:43:20 +08:00
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
files: src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage*
2024-03-15 21:14:05 +08:00
2024-02-15 18:43:20 +08:00
- name: Upload Release
uses: softprops/action-gh-release@v2
2024-02-15 18:43:20 +08:00
with:
tag_name: alpha
name: "Clash Verge Rev Alpha"
body: "More new features are now supported."
2024-02-15 18:43:20 +08:00
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
2024-06-04 10:16:25 +08:00
files: |
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
2024-03-15 21:14:05 +08:00
alpha-for-fixed-webview2:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
arch: x64
- os: windows-latest
target: i686-pc-windows-msvc
arch: x86
- os: windows-latest
target: aarch64-pc-windows-msvc
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Add Rust Target
run: rustup target add ${{ matrix.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: "20"
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false
- name: Pnpm install and check
run: |
pnpm i
pnpm check ${{ matrix.target }}
- name: Download WebView2 Runtime
run: |
invoke-webrequest -uri https://github.com/westinyang/WebView2RuntimeArchive/releases/download/109.0.1518.78/Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -outfile Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab
Expand .\Microsoft.WebView2.FixedVersionRuntime.109.0.1518.78.${{ matrix.arch }}.cab -F:* ./src-tauri
Remove-Item .\src-tauri\tauri.windows.conf.json
Rename-Item .\src-tauri\webview2.${{ matrix.arch }}.json tauri.windows.conf.json
- name: Tauri build
id: build
uses: tauri-apps/tauri-action@v0
env:
2024-05-29 09:49:11 +08:00
NODE_OPTIONS: "--max_old_space_size=4096"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
2024-06-04 10:47:17 +08:00
tauriScript: pnpm
args: --target ${{ matrix.target }}
- name: Rename
run: |
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.exe' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.exe'
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.nsis.zip' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.nsis.zip'
Rename-Item '.\src-tauri\target\${{ matrix.target }}\release\bundle\nsis\Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}-setup.nsis.zip.sig' 'Clash Verge_${{steps.build.outputs.appVersion}}_${{ matrix.arch }}_fixed_webview2-setup.nsis.zip.sig'
- name: Upload Release
2024-05-08 11:12:06 +08:00
uses: softprops/action-gh-release@v2
2024-05-06 15:30:00 +08:00
with:
tag_name: alpha
name: "Clash Verge Rev Alpha"
body: "More new features are now supported."
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
2024-05-06 16:16:47 +08:00
files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*
2024-05-06 19:13:08 +08:00
- name: Portable Bundle
run: pnpm portable-fixed-webview2 ${{ matrix.target }} --alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2024-02-15 19:45:37 +08:00
update_tag:
name: Update tag
runs-on: ubuntu-latest
needs: [alpha, alpha-for-linux, alpha-for-fixed-webview2]
2024-02-15 19:45:37 +08:00
steps:
- name: Checkout repository
uses: actions/checkout@v4
2024-03-15 21:52:56 +08:00
2024-02-15 19:45:37 +08:00
- name: Set Env
run: |
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
shell: bash
2024-03-15 21:52:56 +08:00
2024-02-15 19:45:37 +08:00
- name: Update Tag
uses: richardsimko/update-tag@v1
with:
tag_name: alpha
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2024-03-15 21:52:56 +08:00
2024-02-15 19:45:37 +08:00
- run: |
cat > release.txt << 'EOF'
2024-05-08 11:12:06 +08:00
## 我应该下载哪个版本?
2024-03-15 21:32:39 +08:00
2024-05-08 11:12:06 +08:00
### MacOS (提示文件损坏或开发者无法验证请查看下面FAQ)
2024-03-15 21:32:39 +08:00
- MacOS intel芯片: x64.dmg
2024-05-08 11:12:06 +08:00
- MacOS apple M芯片: aarch64.dmg
### Linux
2024-06-04 12:11:38 +08:00
- Linux 64位: amd64.AppImage/amd64.deb/amd64.rpm
- Linux 32位: i386.deb/i386.rpm
- Linux arm64架构: arm64.deb/aarch64.rpm
- Linux armv7架构: armhf.deb/armhfp.rpm
2024-05-08 11:12:06 +08:00
2024-06-04 12:11:38 +08:00
### Windows (Win7 用户请查看下面FAQ中的解决方案)
2024-05-08 11:12:06 +08:00
#### 正常版本(推荐)
- 64位: x64-setup.exe
- 32位: x86-setup.exe
- arm64架构: arm64-setup.exe
#### 便携版(不推荐使用,无法自动更新)
- 64位: x64_portable.zip
- 32位: x86_portable.zip
- arm64架构: arm64_portable.zip
#### 内置Webview2版(体积较大仅在企业版系统或Win7无法安装webview2时使用)
- 64位: x64_fixed_webview2-setup.exe
- 32位: x86_fixed_webview2-setup.exe
- arm64架构: arm64_fixed_webview2-setup.exe
2024-03-15 21:32:39 +08:00
### FAQ
2024-05-08 11:44:57 +08:00
- [FAQ](https://clash-verge-rev.github.io/faq/windows.html)
2024-03-15 21:32:39 +08:00
2024-02-15 19:45:37 +08:00
Created at ${{ env.BUILDTIME }}.
EOF
2024-03-15 21:52:56 +08:00
2024-02-15 20:05:00 +08:00
- name: Upload Release
uses: softprops/action-gh-release@v2
2024-02-15 20:05:00 +08:00
with:
tag_name: alpha
name: "Clash Verge Rev Alpha"
body_path: release.txt
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
generate_release_notes: true