Publish to crates.io #5
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: Publish to crates.io | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| crate: | |
| description: "Crate to publish (or 'all' in order)" | |
| required: true | |
| default: "all" | |
| type: choice | |
| options: | |
| - all | |
| - resuma-macros | |
| - resuma | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Login to crates.io | |
| run: cargo login "${{ secrets.CRATES_IO_TOKEN }}" | |
| - name: Publish | |
| run: | | |
| publish_one() { | |
| echo "Publishing $1..." | |
| cargo publish -p "$1" | |
| } | |
| if [ "${{ inputs.crate }}" = "all" ]; then | |
| publish_one resuma-macros | |
| sleep 90 | |
| publish_one resuma | |
| else | |
| publish_one "${{ inputs.crate }}" | |
| fi |