crates.io pub #11
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: crates.io pub | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| # Build wingfoil to generate Cargo.lock | |
| - name: Build wingfoil | |
| working-directory: wingfoil | |
| run: cargo build | |
| # Publish wingfoil | |
| - name: Publish wingfoil | |
| working-directory: wingfoil | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }} | |
| run: cargo publish --registry crates-io | |
| # Wait a few seconds to let crates.io index update | |
| - name: Wait for crates.io index | |
| run: sleep 15 | |
| # Set wingfoil version in wingfoil-python | |
| - name: Set wingfoil version in wingfoil-python | |
| working-directory: wingfoil-python | |
| run: | | |
| WINGFOIL_VERSION=$(grep '^version' ../wingfoil/Cargo.toml | head -n1 | sed 's/version = "\(.*\)"/\1/') | |
| echo "Replacing path dependency with version $WINGFOIL_VERSION" | |
| sed -i "s|path = \"../wingfoil\"|version = \"$WINGFOIL_VERSION\"|" Cargo.toml | |
| # Publish wingfoil-python | |
| - name: Publish wingfoil-python | |
| working-directory: wingfoil-python | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }} | |
| run: cargo publish --registry crates-io --allow-dirty |