123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- name: Release Build
- on:
- workflow_dispatch:
- permissions: write-all
- env:
- CARGO_INCREMENTAL: 0
- RUST_BACKTRACE: short
- jobs:
- release:
- strategy:
- fail-fast: false
- matrix:
- include:
- - os: windows-latest
- target: x86_64-pc-windows-msvc
- - os: windows-latest
- target: i686-pc-windows-msvc
- - 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
- uses: dtolnay/rust-toolchain@1.77.0
- - name: Add Rust Target
- run: rustup target add ${{ matrix.target }}
- - name: Rust Cache
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: src-tauri
- cache-all-crates: true
- - name: Install Node
- uses: actions/setup-node@v4
- with:
- node-version: "20"
- - uses: pnpm/action-setup@v4
- name: Install pnpm
- with:
- 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:
- 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 }}
- APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
- APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- APPLE_ID: ${{ secrets.APPLE_ID }}
- APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- with:
- tagName: v__VERSION__
- releaseName: "Clash Verge Rev v__VERSION__"
- releaseBody: "More new features are now supported."
- tauriScript: pnpm
- args: --target ${{ matrix.target }}
- - name: Portable Bundle
- if: matrix.os == 'windows-latest'
- run: pnpm portable ${{ matrix.target }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- release-for-linux:
- strategy:
- fail-fast: false
- matrix:
- include:
- - os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
- - os: ubuntu-latest
- target: i686-unknown-linux-gnu
- - os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
- - os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
- runs-on: ${{ matrix.os }}
- steps:
- - name: Checkout Repository
- uses: actions/checkout@v4
- - name: Build for Linux
- uses: ./.github/build-for-linux
- env:
- NODE_OPTIONS: "--max_old_space_size=4096"
- TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
- TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- with:
- target: ${{ matrix.target }}
- - name: Get Version
- run: |
- sudo apt-get update
- sudo apt-get install jq
- echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
- - name: Upload Release
- uses: softprops/action-gh-release@v2
- with:
- tag_name: v${{env.VERSION}}
- name: "Clash Verge Rev v${{env.VERSION}}"
- body: "More new features are now supported."
- token: ${{ secrets.GITHUB_TOKEN }}
- files: |
- src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
- src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
- release-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@v4
- name: Install pnpm
- with:
- 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:
- 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:
- 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
- uses: softprops/action-gh-release@v2
- with:
- tag_name: v${{steps.build.outputs.appVersion}}
- name: "Clash Verge Rev v${{steps.build.outputs.appVersion}}"
- body: "More new features are now supported."
- token: ${{ secrets.GITHUB_TOKEN }}
- files: src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*setup*
- - name: Portable Bundle
- run: pnpm portable-fixed-webview2 ${{ matrix.target }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- release-update:
- runs-on: ubuntu-latest
- needs: [release, release-for-linux]
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- - name: Install Node
- uses: actions/setup-node@v4
- with:
- node-version: "20"
- - uses: pnpm/action-setup@v4
- name: Install pnpm
- with:
- run_install: false
- - name: Pnpm install
- run: pnpm i
- - name: Release updater file
- run: pnpm updater
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- release-update-for-fixed-webview2:
- runs-on: ubuntu-latest
- needs: [release-for-fixed-webview2]
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- - name: Install Node
- uses: actions/setup-node@v4
- with:
- node-version: "20"
- - uses: pnpm/action-setup@v4
- name: Install pnpm
- with:
- run_install: false
- - name: Pnpm install
- run: pnpm i
- - name: Release updater file
- run: pnpm updater-fixed-webview2
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- submit-to-winget:
- runs-on: ubuntu-latest
- needs: [release-update]
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Get Version
- run: |
- sudo apt-get update
- sudo apt-get install jq
- echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
- - name: Submit to Winget
- uses: vedantmgoyal9/winget-releaser@main
- with:
- identifier: ClashVergeRev.ClashVergeRev
- version: ${{env.VERSION}}
- release-tag: v${{env.VERSION}}
- installers-regex: '_(arm64|x64|x86)-setup\.exe$'
- token: ${{ secrets.WINGET_TOKEN }}
|