Merge pull request #83 from dfinity/shiling/update #18
Workflow file for this run
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 ic-bn-lib to crates.io | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| publish-ic-bn-lib: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC token exchange | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: rust-lang/crates-io-auth-action@v1 | |
| id: auth | |
| - name: Set Cargo.toml version | |
| shell: bash | |
| env: | |
| RELEASE_TAG: ${{ github.ref }} | |
| run: | | |
| mv ic-bn-lib/Cargo.toml ic-bn-lib/Cargo.toml.orig | |
| sed "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" ic-bn-lib/Cargo.toml.orig > ic-bn-lib/Cargo.toml | |
| rm -f ic-bn-lib/Cargo.toml.orig | |
| - run: cargo publish --package ic-bn-lib --allow-dirty | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | |
| - name: Send Slack message | |
| uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a | |
| with: | |
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| text: "New `ic-bn-lib` crate (version `${{ github.ref_name }}`) has been published to crates.io" |