Factor out stream-guard into separate library #15
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: Publish | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
environment: | |
name: crates.io | |
url: ${{ steps.set_url.outputs.env_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build | |
run: cargo build --all | |
- name: Check version | |
id: version | |
run: | | |
echo "==> Checking version..." | |
pkg_version="$(grep '^version =' "Cargo.toml" | sed 's/version = "\(.*\)"/\1/g')" | |
tag_version="$(echo "$GITHUB_REF" | sed -e "s#refs/tags/v##g")" | |
if [ "$pkg_version" != "$tag_version" ]; then | |
echo "Package version '$pkg_version' does not match tag version '$tag_version'!" >&2 | |
exit 1 | |
fi | |
echo "version=$tag_version" >> "$GITHUB_OUTPUT" | |
- name: Publish lighthouse-protocol | |
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} | |
working-directory: lighthouse-protocol | |
- name: Publish lighthouse-client | |
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} | |
working-directory: lighthouse-client | |
- name: Set environment url | |
id: set_url | |
run: | | |
version="${{ steps.version.outputs.version }}" | |
echo "env_url=https://crates.io/crates/lighthouse-client/$version" >> "$GITHUB_OUTPUT" |