Skip to content
Snippets Groups Projects
alpha.yml 2.44 KiB
Newer Older
GyDi's avatar
GyDi committed
name: Alpha CI
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
on:
  workflow_dispatch:
GyDi's avatar
GyDi committed
    inputs:
      debug:
        type: boolean
        default: false
GyDi's avatar
GyDi committed

env:
  CARGO_INCREMENTAL: 0
  RUST_BACKTRACE: short

jobs:
  release:
    strategy:
GyDi's avatar
GyDi committed
      fail-fast: false
GyDi's avatar
GyDi committed
      matrix:
GyDi's avatar
GyDi committed
        os: [windows-latest, ubuntu-20.04, macos-latest]
GyDi's avatar
GyDi committed
    runs-on: ${{ matrix.os }}
    if: startsWith(github.repository, 'zzzgydi')
    steps:
      - name: Checkout repository
GyDi's avatar
GyDi committed
        uses: actions/checkout@v3
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
GyDi's avatar
GyDi committed

      - name: Rust Cache
GyDi's avatar
GyDi committed
        uses: Swatinem/rust-cache@v2
GyDi's avatar
GyDi committed
        with:
GyDi's avatar
GyDi committed
          workspaces: src-tauri
GyDi's avatar
GyDi committed

      - name: Install Node
GyDi's avatar
GyDi committed
        uses: actions/setup-node@v3
GyDi's avatar
GyDi committed
        with:
GyDi's avatar
GyDi committed
          node-version: "16"
          cache: "yarn"
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Delete current release assets
GyDi's avatar
GyDi committed
        if: startsWith(matrix.os, 'ubuntu-')
GyDi's avatar
GyDi committed
        uses: mknejp/delete-release-assets@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          tag: alpha
          fail-if-no-assets: false
          fail-if-no-release: false
          assets: |
            *.zip
            *.gz
            *.AppImage
            *.deb
            *.dmg
            *.msi
            *.sig

GyDi's avatar
GyDi committed
      - name: Install Dependencies (ubuntu only)
GyDi's avatar
GyDi committed
        if: startsWith(matrix.os, 'ubuntu-')
GyDi's avatar
GyDi committed
        run: |
GyDi's avatar
GyDi committed
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf openssl
GyDi's avatar
GyDi committed

      - name: Yarn install and check
        run: |
GyDi's avatar
GyDi committed
          yarn install --network-timeout 1000000 --frozen-lockfile
GyDi's avatar
GyDi committed
          yarn run check
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Tauri build
GyDi's avatar
GyDi committed
        uses: tauri-apps/tauri-action@v0
GyDi's avatar
GyDi committed
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
        with:
          tagName: alpha
          releaseName: "Clash Verge Alpha"
GyDi's avatar
GyDi committed
          releaseBody: "Alpha Version (include debug)"
          releaseDraft: false
GyDi's avatar
GyDi committed
          prerelease: true
GyDi's avatar
GyDi committed
          includeDebug: ${{ github.event.inputs.debug }}
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Portable Bundle
GyDi's avatar
GyDi committed
        if: startsWith(matrix.os, 'windows-')
GyDi's avatar
GyDi committed
        run: |
GyDi's avatar
GyDi committed
          yarn build
GyDi's avatar
GyDi committed
          yarn run portable
        env:
          TAG_NAME: alpha
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GyDi's avatar
GyDi committed
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
          VITE_WIN_PORTABLE: 1