update dependencies #47
Workflow file for this run
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: ci | |
on: | |
push | |
jobs: | |
rust_compile: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: cargo fmt check | |
run: | | |
cargo fmt --check --verbose | |
- name: cargo build | |
run: | | |
cargo build --release | |
- name: cargo test | |
run: | | |
cargo test --release | |
- name: cargo clippy | |
run: | | |
cargo clippy --no-deps | |
- name: cargo doc | |
run: | | |
cargo doc --release --no-deps | |
- name: cargo deny | |
run: | | |
export CARGO_DENY_VERSION="0.16.3" | |
export DENY_RELEASE="cargo-deny-${CARGO_DENY_VERSION}-x86_64-unknown-linux-musl" | |
wget https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/${DENY_RELEASE}.tar.gz | |
wget https://github.com/EmbarkStudios/cargo-deny/releases/download/${CARGO_DENY_VERSION}/${DENY_RELEASE}.tar.gz.sha256 | |
EXPECTED="$(cat ${DENY_RELEASE}.tar.gz.sha256)" | |
echo "${EXPECTED} ${DENY_RELEASE}.tar.gz" | sha256sum --check | |
tar xvzf $DENY_RELEASE.tar.gz | |
$DENY_RELEASE/cargo-deny check all | |
# TODO: audit / outdated check? | |
publish_crate: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: rust_compile | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: "${{ secrets.NO_BROWSER_CARGO_TOKEN }}" | |
run: | | |
sed --in-place "s/version = \"0.0.0\"/version = \"$GITHUB_REF_NAME\"/g" Cargo.toml | |
cargo publish --dry-run --allow-dirty | |
cargo package --list --allow-dirty | |
cargo publish --allow-dirty | |
github_release: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: publish_crate | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: github release | |
uses: softprops/[email protected] | |
with: | |
prerelease: ${{ contains(github.ref_name, '-') }} | |
generate_release_notes: true |