name: CI on: push: branches: [main] tags: ["v*"] pull_request: jobs: test: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - name: Linux GUI dependencies if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y libxkbcommon-dev libgtk-3-dev - run: cargo fmt --check - run: cargo clippy --all-targets -- -D warnings - run: cargo test --release release: if: startsWith(github.ref, 'refs/tags/v') needs: test strategy: matrix: include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu - os: windows-latest target: x86_64-pc-windows-msvc - os: macos-latest target: aarch64-apple-darwin runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - name: Linux GUI dependencies if: runner.os == 'Linux' run: sudo apt-get update && sudo apt-get install -y libxkbcommon-dev libgtk-3-dev - run: cargo build --release --target ${{ matrix.target }} - name: Package shell: bash run: | name=logreadlite-${GITHUB_REF_NAME}-${{ matrix.target }} mkdir "$name" cp README.md "$name/" if [ "$RUNNER_OS" = "Windows" ]; then cp target/${{ matrix.target }}/release/logreadlite.exe "$name/" 7z a "$name.zip" "$name" else cp target/${{ matrix.target }}/release/logreadlite "$name/" tar czf "$name.tar.gz" "$name" fi - uses: softprops/action-gh-release@v2 with: files: logreadlite-*.*