prux 1.3.0

A minimal terminal coding agent: TUI, built-in coding tools, and an extension system
name: linux
on: [push]

permissions:
  contents: write

jobs:
  action-run:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v3
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "The ${{ github.workspace }} is now ready to test your code on the runner."
      - run: ls ${{ github.workspace }}
      - run: sudo apt update
      # libxkbcommon: enigo 的 wayland 后端(虚拟键盘 keymap);libwayland: wayland-client;
      # libpipewire + libxcb: xcap 在 Linux 上的依赖;
      # libegl1-mesa-dev: 提供 egl.pc 与 libEGL,供 xcap → libwayshot-xcap → khronos-egl 链接;
      # libgbm-dev: 提供 libgbm.so,供 libwayshot-xcap → gbm-sys 链接(缺了报 `unable to find library -lgbm`)。
      - run: sudo apt install -y fd-find ripgrep libxkbcommon-dev libwayland-dev libpipewire-0.3-dev libxcb1-dev libxcb-randr0-dev libegl1-mesa-dev libgbm-dev

      - run: echo "start install Rust..."
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - run: echo "end install Rust..."

      - run: echo "start build..."
      - run: make
      - run: echo "end build..."

      # 测试:全量跑(含死锁/竞态回归护栏:watchdog 超时 + 线程本地隔离)
      - run: echo "start test..."
      - run: cargo test
      - run: echo "end test..."

      - name: Get the release version from the tag
        shell: bash
        run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

      - run: echo "start packing..."
      - run: make app-name
      - name: Export package
        shell: bash
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          cd target
          binary_name=`cat app-name`
          output="$binary_name-${{ env.VERSION }}-x86_64-linux.tar.gz"
          cp -rf release/$binary_name $binary_name
          tar -zcf $output $binary_name
          cp $output ..
          echo "ASSET=$output" >> $GITHUB_ENV
      - run: echo "end packing..."

      - name: Upload the package
        uses: softprops/action-gh-release@v2
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            ${{ env.ASSET }}

      - run: echo "🍏 This job's status is ${{ job.status }}."