publish on release creation #1
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 on release creation | |
| on: | |
| release: | |
| types: | |
| - created | |
| workflow_dispatch: | |
| jobs: | |
| publish-crates: | |
| name: Publish librespot | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libasound2-dev | |
| - name: Verify librespot workspace | |
| run: cargo publish --workspace --dry-run | |
| - name: Publish librespot workspace | |
| if: ${{ !env.ACT }} | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish --workspace |