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: r3-os/actions-rust-toolchain@a862b6623c178b43a3135516442a5f72fb5c1877
with:
profile: minimal
toolchain: stable
override: true
- uses: taiki-e/install-action@nextest
- name: 'Build and test'
uses: r3-os/actions-rust-cargo@fb222fe18dc90e381546d012f9e3d6f353f0f627
with:
command: nextest
args: run --workspace
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: r3-os/actions-rust-toolchain@a862b6623c178b43a3135516442a5f72fb5c1877
with:
profile: minimal
toolchain: stable
override: true
- uses: taiki-e/install-action@nextest
- name: 'Build and test'
uses: r3-os/actions-rust-cargo@fb222fe18dc90e381546d012f9e3d6f353f0f627
with:
command: nextest
args: run --workspace
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: r3-os/actions-rust-toolchain@a862b6623c178b43a3135516442a5f72fb5c1877
with:
profile: minimal
toolchain: stable
override: true
- name: cargo-release Cache
id: cargo_release_cache
uses: actions/cache@v3
with:
path: ~/.cargo/bin/cargo-release
key: ${{ runner.os }}-cargo-release
- uses: r3-os/actions-rust-cargo@fb222fe18dc90e381546d012f9e3d6f353f0f627
if: steps.cargo_release_cache.outputs.cache-hit != 'true'
with:
command: install
args: cargo-release
- name: cargo login
uses: r3-os/actions-rust-cargo@fb222fe18dc90e381546d012f9e3d6f353f0f627
with:
command: login
args: ${{ secrets.CRATES_IO_API_TOKEN }}
- name: "cargo release publish"
run: |-
cargo release \
publish \
--workspace \
--allow-branch HEAD \
--no-confirm \
--execute