mirror of https://github.com/sayanarijit/xplr
parent
8dae2fef4d
commit
dba8631911
@ -0,0 +1,91 @@
|
||||
name: Continuous Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publishing for ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
rust: [stable]
|
||||
include:
|
||||
- os: macos-latest
|
||||
artifact_prefix: macos
|
||||
target: x86_64-apple-darwin
|
||||
binary_postfix: ""
|
||||
- os: ubuntu-latest
|
||||
artifact_prefix: linux
|
||||
target: x86_64-unknown-linux-gnu
|
||||
binary_postfix: ""
|
||||
# - os: windows-latest
|
||||
# artifact_prefix: windows
|
||||
# target: x86_64-pc-windows-msvc
|
||||
# binary_postfix: ".exe"
|
||||
|
||||
steps:
|
||||
- name: Installing Rust toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
- name: Installing needed macOS dependencies
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: brew install openssl@1.1
|
||||
- name: Installing needed Ubuntu dependencies
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
- name: Checking out sources
|
||||
uses: actions/checkout@v1
|
||||
- name: Running cargo build
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
toolchain: ${{ matrix.rust }}
|
||||
args: --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Packaging final binary
|
||||
shell: bash
|
||||
run: |
|
||||
cd target/${{ matrix.target }}/release
|
||||
BINARY_NAME=spt${{ matrix.binary_postfix }}
|
||||
strip $BINARY_NAME
|
||||
RELEASE_NAME=xplr-${{ matrix.artifact_prefix }}
|
||||
tar czvf $RELEASE_NAME.tar.gz $BINARY_NAME
|
||||
if [[ ${{ runner.os }} == 'Windows' ]]; then
|
||||
certutil -hashfile $RELEASE_NAME.tar.gz sha256 | grep -E [A-Fa-f0-9]{64} > $RELEASE_NAME.sha256
|
||||
else
|
||||
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
|
||||
fi
|
||||
- name: Releasing assets
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
target/${{ matrix.target }}/release/xplr-${{ matrix.artifact_prefix }}.tar.gz
|
||||
target/${{ matrix.target }}/release/xplr-${{ matrix.artifact_prefix }}.sha256
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
publish-cargo:
|
||||
name: Publishing to Cargo
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y -qq pkg-config libssl-dev libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: publish
|
||||
args: --token ${{ secrets.CARGO_API_KEY }} --allow-dirty
|
@ -0,0 +1,104 @@
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: master
|
||||
workflow_dispatch:
|
||||
|
||||
name: Continuous Integration
|
||||
|
||||
jobs:
|
||||
# Workaround for making Github Actions skip based on commit message `[skip ci]`
|
||||
# Source https://gist.github.com/ybiquitous/c80f15c18319c63cae8447a3be341267
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
!contains(format('{0} {1} {2}', github.event.head_commit.message, github.event.pull_request.title, github.event.pull_request.body), '[skip ci]')
|
||||
steps:
|
||||
- run: |
|
||||
cat <<'MESSAGE'
|
||||
github.event_name: ${{ toJson(github.event_name) }}
|
||||
github.event:
|
||||
${{ toJson(github.event) }}
|
||||
MESSAGE
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
|
||||
test:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
# These dependencies are required for `clipboard`
|
||||
- run: sudo apt-get install -y -qq libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
|
||||
bench:
|
||||
name: Benchmarks
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
# These dependencies are required for `clipboard`
|
||||
- run: sudo apt-get install -y -qq libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: bench
|
||||
|
||||
fmt:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
components: rustfmt
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
components: clippy
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: clippy
|
||||
args: -- -D warnings
|
@ -1,7 +1,11 @@
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
#![allow(clippy::from_over_into)]
|
||||
#![allow(clippy::unnecessary_wraps)]
|
||||
|
||||
pub mod app;
|
||||
pub mod config;
|
||||
pub mod event_reader;
|
||||
pub mod explorer;
|
||||
pub mod input;
|
||||
pub mod ui;
|
||||
pub mod pipe_reader;
|
||||
pub mod event_reader;
|
||||
pub mod ui;
|
||||
|
Loading…
Reference in New Issue