diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa5cb8952..034e3d602 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,8 @@ concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} +permissions: {} + jobs: clippy: name: clippy @@ -25,8 +27,11 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: created empty dist dir - run: "mkdir dist" + run: | + mkdir dist + - name: install dependencies (linux) if: startsWith(runner.os,'Linux') run: | @@ -35,19 +40,26 @@ jobs: libwebkit2gtk-4.0-dev \ libappindicator3-dev \ librsvg2-dev \ - patchelf + patchelf \ + libprotobuf-dev \ + protobuf-compiler + - name: toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt + - name: cache cargo files and outputs if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }} uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' + - name: cargo format working-directory: ./src-tauri - run: cargo fmt --all -- --check + run: | + cargo fmt --all -- --check + - name: clippy check (with lints) working-directory: ./src-tauri run: | @@ -60,15 +72,18 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt + - name: cache cargo files and outputs if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }} uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' + - name: cargo machete working-directory: ./src-tauri run: | @@ -81,6 +96,7 @@ jobs: steps: - name: checkout uses: actions/checkout@v4 + - name: install dependencies (linux) if: startsWith(runner.os,'Linux') run: | @@ -89,16 +105,22 @@ jobs: libwebkit2gtk-4.0-dev \ libappindicator3-dev \ librsvg2-dev \ - patchelf + patchelf \ + libprotobuf-dev \ + protobuf-compiler + - name: toolchain uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt + - name: cache cargo files and outputs if: ${{ ( startsWith(runner.environment,'github-hosted') ) && ( ! startsWith(github.ref, 'refs/tags/v') ) }} uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' + - name: cargo check working-directory: ./src-tauri - run: cargo check --release --all-targets --workspace --locked + run: | + cargo check --release --all-targets --workspace --locked diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3125afcad..58cb13235 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,10 +5,10 @@ name: Release push: paths-ignore: - '**/*.md' - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' + # tags: + # - 'v[0-9]+.[0-9]+.[0-9]+' branches: - - 'main' + - 'release' - 'build-*' workflow_dispatch: @@ -29,7 +29,7 @@ jobs: matrix: include: # - platform: 'ubuntu-20.04' - # args: '' + # args: '' - platform: 'windows-2019' args: '' - platform: 'macos-latest' @@ -46,12 +46,6 @@ jobs: node-version: lts/* cache: 'npm' - - name: Rust setup (macOS) - if: startsWith(runner.os,'macOS') - uses: dtolnay/rust-toolchain@stable - with: - target: aarch64-apple-darwin,x86_64-apple-darwin - - name: Rust setup (linux) if: startsWith(runner.os,'Linux') uses: dtolnay/rust-toolchain@stable @@ -59,23 +53,18 @@ jobs: toolchain: stable target: aarch64-unknown-linux-gnu + - name: Rust setup (macOS) + if: startsWith(runner.os,'macOS') + uses: dtolnay/rust-toolchain@stable + with: + target: aarch64-apple-darwin,x86_64-apple-darwin + - name: Cache cargo files and outputs if: ${{ ( ! startsWith(github.ref, 'refs/tags/v') ) }} uses: swatinem/rust-cache@v2 with: workspaces: './src-tauri -> target' - - - name: Install Windows dependencies - if: startsWith(runner.os,'Windows') - run: | - choco upgrade protoc -y - - - name: Install dependencies (Macos) - if: startsWith(runner.os,'macOS') - run: | - brew install protobuf - - name: Install dependencies (linux) if: startsWith(runner.os,'Linux') run: | @@ -85,7 +74,26 @@ jobs: libappindicator3-dev \ librsvg2-dev \ patchelf \ - protobuf-compiler + libprotobuf-dev \ + protobuf-compiler + + - name: Install dependencies (macOS) + if: startsWith(runner.os,'macOS') + run: | + # openssl, cmake and autoconf already installed + brew install zip coreutils automake protobuf libtool + + - name: Install dependencies (Windows) + if: startsWith(runner.os,'Windows') + run: | + vcpkg.exe install sqlite3:x64-windows zlib:x64-windows + choco upgrade protoc -y + + - name: Set environment variables (Windows) + if: startsWith(runner.os,'Windows') + shell: bash + run: | + echo "SQLITE3_LIB_DIR=C:\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV - name: Install dependencies (node) run: |