Skip to content

Raise broadcast cycle limit to 5 to fix Esc-exit panic #303

Raise broadcast cycle limit to 5 to fix Esc-exit panic

Raise broadcast cycle limit to 5 to fix Esc-exit panic #303

Workflow file for this run

name: Release
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Install XCB dependencies
run: sudo apt-get update && sudo apt-get install -y libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Check formatting
run: cargo fmt --check
- name: Lint
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test
- name: Audit dependencies
run: cargo install cargo-audit && cargo audit
build:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Install XCB dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Build
run: cargo build --release
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: filectrl-${{ matrix.os }}
path: target/release/filectrl
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Delete previous dev release
if: github.ref == 'refs/heads/main'
run: |
gh release delete dev --yes || true
git push --delete origin refs/tags/dev || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir release-assets
cp artifacts/filectrl-ubuntu-latest/filectrl release-assets/filectrl-linux
cp artifacts/filectrl-macos-latest/filectrl release-assets/filectrl-macos
- name: Create release
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref == 'refs/heads/main' && 'dev' || github.ref_name }}
name: ${{ github.ref == 'refs/heads/main' && 'dev' || github.ref_name }}
body: ${{ github.ref == 'refs/heads/main' && 'Latest build from main branch' || '' }}
make_latest: ${{ github.ref == 'refs/heads/main' && 'false' || 'true' }}
files: |
release-assets/filectrl-linux
release-assets/filectrl-macos