Merge pull request #185 from azriel91/maintenance/release-0-0-13 #21
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
on: | |
push: | |
tags: | |
- '*' | |
name: Publish | |
jobs: | |
audit: | |
name: Audit | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: bp3d-actions/audit-check@9c23bd47e5e7b15b824739e0862cb878a52cc211 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
build_and_test_linux: | |
name: Build and Test (Linux) | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@nextest | |
- name: 'Build and test' | |
run: cargo nextest run --workspace --all-features | |
build_and_test_windows: | |
name: Build and Test (Windows) | |
runs-on: windows-latest | |
timeout-minutes: 20 | |
steps: | |
- name: Prepare symlink configuration | |
run: git config --global core.symlinks true | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: taiki-e/install-action@nextest | |
- name: 'Build and test' | |
run: cargo nextest run --workspace --all-features | |
crates_io_publish: | |
name: Publish (crates.io) | |
needs: | |
- audit | |
- build_and_test_linux | |
- build_and_test_windows | |
runs-on: ubuntu-latest | |
timeout-minutes: 25 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: cargo-release Cache | |
id: cargo_release_cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo/bin/cargo-release | |
key: ${{ runner.os }}-cargo-release | |
- run: cargo install cargo-release | |
if: steps.cargo_release_cache.outputs.cache-hit != 'true' | |
- name: cargo login | |
run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }} | |
# allow-branch HEAD is because GitHub actions switches | |
# to the tag while building, which is a detached head | |
# Publishing is currently messy, because: | |
# | |
# * `peace_rt_model_core` exports `NativeError` or `WebError` depending on the target. | |
# * `peace_rt_model_web` fails to build when publishing the workspace for a native target. | |
# * `peace_rt_model_web` still needs its dependencies to be published before it can be | |
# published. | |
# * `peace_rt_model_hack` needs `peace_rt_model_web` to be published before it can be | |
# published. | |
# | |
# We *could* pass through `--no-verify` so `cargo` doesn't build the crate before publishing, | |
# which is reasonable, since this job only runs after the Linux, Windows, and WASM builds | |
# have passed. | |
- name: "cargo release publish" | |
run: |- | |
cargo release \ | |
publish \ | |
--workspace \ | |
--all-features \ | |
--allow-branch HEAD \ | |
--no-confirm \ | |
--no-verify \ | |
--execute |