-
Notifications
You must be signed in to change notification settings - Fork 5
chore: Add workflow to publish to crates.io #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
derlerd-dfinity
wants to merge
21
commits into
main
Choose a base branch
from
dderler/publish-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4c9edde
.
derlerd-dfinity 6928f8e
.
derlerd-dfinity d1b15fe
.
derlerd-dfinity 715f64b
.
derlerd-dfinity 7c9223f
.
derlerd-dfinity b161e7b
.
derlerd-dfinity 5637d02
.
derlerd-dfinity 72e35f2
.
derlerd-dfinity a516849
Allow dirty working directory because of sed changes
derlerd-dfinity 131d252
.
derlerd-dfinity f8876cd
.
derlerd-dfinity 3948af1
Temporarily disable benchmark
derlerd-dfinity b07c99f
.
derlerd-dfinity 052aec5
.
derlerd-dfinity fc57c7b
.
derlerd-dfinity cf3273d
.
derlerd-dfinity c076b4a
Update .github/workflows/publish.yml
derlerd-dfinity baf9e95
Update .github/workflows/publish.yml
derlerd-dfinity 0277d82
.
derlerd-dfinity 13162ce
.
derlerd-dfinity 823b898
.
derlerd-dfinity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Publish canbench crates to crates.io | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| jobs: | ||
| publish-canbench: | ||
| 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: | | ||
| sed -i -e "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" canbench-rs-macros/Cargo.toml | ||
| sed -i -e "s/\(^canbench-rs-macros.*\"\).* }/\1, version=\"${RELEASE_TAG##*\/v}\" }/" canbench-rs/Cargo.toml | ||
| sed -i -e "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" canbench-rs/Cargo.toml | ||
| sed -i -e "s/\(^canbench-rs.*\"\).* }/\1, version=\"${RELEASE_TAG##*\/v}\" }/" canbench-bin/Cargo.toml | ||
| sed -i -e "s/0\\.0\\.0-git/${RELEASE_TAG##*\/v}/" canbench-bin/Cargo.toml | ||
|
|
||
| - run: cargo publish -p canbench-rs-macros --allow-dirty | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | ||
|
|
||
| - run: cargo publish -p canbench-rs --allow-dirty | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | ||
|
|
||
| - run: cargo publish -p canbench --allow-dirty | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | ||
|
|
||
| - name: Post to a Slack channel | ||
| uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0 | ||
| with: | ||
| channel-id: eng-dsm-alerts | ||
| slack-message: "New `canbench` crates (version `${{ github.ref_name }}`) has been published to crates.io" | ||
| env: | ||
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_API_TOKEN }} | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,4 +30,4 @@ benches: | |
| heap_increase: 0 | ||
| stable_memory_increase: 0 | ||
| scopes: {} | ||
| version: 0.2.1 | ||
| version: 0.0.0-git | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,4 +34,4 @@ benches: | |
| heap_increase: 0 | ||
| stable_memory_increase: 0 | ||
| scopes: {} | ||
| version: 0.2.1 | ||
| version: 0.0.0-git | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,4 +6,4 @@ benches: | |
| heap_increase: 0 | ||
| stable_memory_increase: 0 | ||
| scopes: {} | ||
| version: 0.1.10 | ||
| version: 0.0.0-git | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,4 +95,4 @@ benches: | |
| calls: 20 | ||
| heap_increase: 0 | ||
| instructions: 20000000 | ||
| version: 0.1.15 | ||
| version: 0.0.0-git | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.