chore(deps): Update dependencies #61
This file contains 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: Main workflow | |
on: push | |
jobs: | |
# Run the `rustfmt` code formatter | |
rustfmt: | |
name: Rustfmt [Formatter] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt | |
override: true | |
- run: rustup component add rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
# Ensure that the project could be successfully compiled | |
cargo_check: | |
name: Compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
- name: Check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target x86_64-unknown-linux-gnu | |
- name: Post-Build | |
run: | | |
strip target/x86_64-unknown-linux-gnu/release/cindy-next-rust | |
mv target/x86_64-unknown-linux-gnu/release/cindy-next-rust cindy-next-rust | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
path: "cindy-next-rust" | |
# Create GitHub release with Rust build targets and release notes | |
github_release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Create GitHub Release | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-apple-darwin | |
#- x86_64-pc-windows-msvc | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: cindy-next-rust-x86_64-unknown-linux-gnu.tar.gz | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
name: cindy-next-rust-x86_64-apple-darwin.tar.gz | |
#- target: x86_64-pc-windows-msvc | |
# os: windows-latest | |
# name: cindy-next-rust-x86_64-pc-windows-msvc.zip | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
target: ${{ matrix.target }} | |
- name: Build target | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Prepare build artifacts [Windows] | |
if: matrix.os == 'windows-latest' | |
run: | | |
strip target/${{ matrix.target }}/release/cindy-next-rust.exe | |
mv target/${{ matrix.target }}/release/cindy-next-rust.exe cindy-next-rust.exe | |
7z a ${{ matrix.name }} cindy-next-rust.exe | |
- name: Prepare build artifacts [-nix] | |
if: matrix.os != 'windows-latest' | |
run: | | |
strip target/${{ matrix.target }}/release/cindy-next-rust | |
mv target/${{ matrix.target }}/release/cindy-next-rust cindy-next-rust | |
tar czvf ${{ matrix.name }} cindy-next-rust | |
- name: Create GitHub release ${{ matrix.target }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ matrix.name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |