Add a [theme256] fallback for terminals that don't support truecolor #121
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.ref }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| - 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 artifacts | |
| uses: actions/upload-artifact@v4 | |
| 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/')) | |
| steps: | |
| # We need to checkout the code in order to delete the "main" tag | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.ref }} | |
| - name: Delete the previous "main" tag and release if they exist | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| gh release delete main --yes || true | |
| git push --delete origin refs/tags/main || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare assets for release | |
| run: | | |
| mkdir release-assets | |
| cp artifacts/filectrl-ubuntu-latest/filectrl release-assets/filectrl-linux | |
| cp artifacts/filectrl-macos-latest/filectrl release-assets/filectrl-macos | |
| # GitHub releases require a tag, so this step will auto-create a tag for the "main" release. | |
| # We delete the 'main' tag in advance (above), so that step will create a new one that points | |
| # to the latest revision on the main branch | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref == 'refs/heads/main' && 'main' || github.ref_name }} | |
| name: ${{ github.ref == 'refs/heads/main' && 'main' || github.ref_name }} | |
| body: ${{ github.ref == 'refs/heads/main' && 'Latest build from main branch' || '' }} | |
| files: | | |
| release-assets/filectrl-linux | |
| release-assets/filectrl-macos |