Bump actions/download-artifact from 1 to 4.1.7 in /.github/workflows #57
Workflow file for this run
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: Build | |
on: | |
push: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
pull_request: | |
paths-ignore: | |
- "docs/**" | |
- "**.md" | |
jobs: | |
# Ensure that the project could be successfully compiled | |
cargo_check: | |
name: Check Code Compiles | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --all | |
# Run the `rustfmt` code formatter | |
rustfmt: | |
name: Rustfmt [Formatter] | |
needs: cargo_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt | |
override: true | |
- run: rustup component add rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
# Run the `clippy` linting tool | |
clippy: | |
name: Clippy [Linter] | |
needs: cargo_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: clippy | |
override: true | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets --all-features -- -D clippy::all | |
# Run a security audit on dependencies | |
cargo_audit: | |
name: Cargo Audit [Security] | |
needs: cargo_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- run: cargo install --force cargo-audit | |
- run: cargo generate-lockfile | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: audit | |
test: | |
needs: [cargo_check] | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
rust: [stable, nightly] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
github_build: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Build release binaries | |
strategy: | |
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: hmm-x86_64-unknown-linux-gnu.tar.gz | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
name: hmm-x86_64-apple-darwin.tar.gz | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
name: hmm-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: stable | |
override: true | |
target: ${{ matrix.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: | | |
cd target/${{ matrix.target }}/release | |
strip hmm.exe | |
strip hmmq.exe | |
strip hmmp.exe | |
7z a ../../../${{ matrix.name }} hmm.exe hmmq.exe hmmp.exe | |
cd - | |
- name: Prepare build artifacts [-nix] | |
if: matrix.os != 'windows-latest' | |
run: | | |
cd target/${{ matrix.target }}/release | |
strip hmm | |
strip hmmq | |
strip hmmp | |
tar czvf ../../../${{ matrix.name }} hmm hmmq hmmp | |
cd - | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: ${{ matrix.name }} | |
path: ${{ matrix.name }} | |
github_release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Create GitHub Release | |
needs: [test, github_build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download releases from github_build | |
uses: actions/[email protected] | |
with: | |
name: hmm-x86_64-unknown-linux-gnu.tar.gz | |
path: . | |
- name: Download releases from github_build | |
uses: actions/[email protected] | |
with: | |
name: hmm-x86_64-apple-darwin.tar.gz | |
path: . | |
- name: Download releases from github_build | |
uses: actions/[email protected] | |
with: | |
name: hmm-x86_64-pc-windows-msvc.zip | |
path: . | |
- name: Generate checksums | |
run: for file in hmm-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done | |
- name: Create GitHub release ${{ matrix.target }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
hmm-x86_64-unknown-linux-gnu.tar.gz | |
hmm-x86_64-unknown-linux-gnu.tar.gz.sha256 | |
hmm-x86_64-apple-darwin.tar.gz | |
hmm-x86_64-apple-darwin.tar.gz.sha256 | |
hmm-x86_64-pc-windows-msvc.zip | |
hmm-x86_64-pc-windows-msvc.zip.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
cargo_publish: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
name: Publish Cargo Package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- run: cargo login $CRATES_IO_TOKEN | |
- run: cargo publish | |
env: | |
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |