Add auto-collapse sidebar feature in code settings and implement rela… #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| name: Rust tests | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src-tauri | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| src-tauri/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Run tests | |
| run: cargo test --locked --all-targets | |
| build: | |
| name: Build desktop bundles | |
| needs: test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, macos-13, macos-14 ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Determine build metadata | |
| id: metadata | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| BUILD_ID="pr${{ github.event.number }}-${{ github.run_attempt }}" | |
| else | |
| BUILD_ID="${{ github.run_number }}" | |
| fi | |
| echo "COMMANDER_BUILD_ID=$BUILD_ID" >> "$GITHUB_ENV" | |
| echo "build_id=$BUILD_ID" >> "$GITHUB_OUTPUT" | |
| - name: Inject build metadata version | |
| id: set_version | |
| shell: bash | |
| run: | | |
| BUILD_VERSION=$(node scripts/ci-set-version.mjs) | |
| echo "BUILD_VERSION=$BUILD_VERSION" >> "$GITHUB_ENV" | |
| echo "build_version=$BUILD_VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install Linux build dependencies | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential curl wget file libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf pkg-config | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| src-tauri/target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('src-tauri/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Install frontend dependencies | |
| run: bun install --ci | |
| - name: Build Tauri app | |
| run: bun run tauri build | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: commander-${{ steps.set_version.outputs.build_version }}-${{ matrix.os }}-${{ runner.arch }} | |
| path: src-tauri/target/release/bundle/** | |
| release: | |
| name: Release artifacts | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Compute release version | |
| id: release_version | |
| run: | | |
| BASE_VERSION=$(jq -r '.version' src-tauri/tauri.conf.json) | |
| BASE_VERSION=${BASE_VERSION%%+*} | |
| RELEASE_VERSION="$BASE_VERSION+build.${{ github.run_number }}" | |
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_ENV" | |
| echo "release_version=$RELEASE_VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: Collect release assets | |
| run: node scripts/collect-release-assets.mjs dist release | |
| - name: Generate checksums | |
| shell: bash | |
| run: | | |
| cd release | |
| shopt -s nullglob | |
| files=(*) | |
| if [ ${#files[@]} -gt 0 ]; then | |
| sha256sum "${files[@]}" > SHA256SUMS.txt | |
| fi | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.release_version.outputs.release_version }} | |
| name: Commander ${{ steps.release_version.outputs.release_version }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| release/* | |
| body: | | |
| ## Commander ${{ steps.release_version.outputs.release_version }} | |
| - Automated build for macOS (Intel & Apple Silicon) and Linux. | |
| - SHA256 checksums included in `SHA256SUMS.txt`. | |