-
Notifications
You must be signed in to change notification settings - Fork 3
chore: Add rust release CI #329
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
89f84f7
update manifests and add CI
DaughterOfMars 80b3b5e
publish all
DaughterOfMars 7a242e2
exclude the build crate
DaughterOfMars e65e0b5
exclude ffi too
DaughterOfMars 6221f0b
fix manifests
DaughterOfMars 3fc95a5
split process into two
DaughterOfMars f0e0348
add flags
DaughterOfMars 3b470d2
add pre-publish
DaughterOfMars f67fdb0
add cargo release version and dry run release
DaughterOfMars ae49f78
remove publish config
DaughterOfMars a30d055
review
DaughterOfMars 5e14d0f
review
DaughterOfMars 87300b7
remove ffi
DaughterOfMars 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Pre-publish | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| level: | ||
| type: string | ||
| required: true | ||
| description: | | ||
| The level of version bump to make. | ||
|
|
||
| Possible values: | ||
| - major: Increase the major version (x.0.0) | ||
| - minor: Increase the minor version (x.y.0) | ||
| - patch: Increase the patch version (x.y.z) | ||
| - release: Remove the pre-version (x.y.z) | ||
| - rc: Increase the rc pre-version (x.y.z-rc.M) | ||
| - beta: Increase the beta pre-version (x.y.z-beta.M) | ||
| - alpha: Increase the alpha pre-version (x.y.z-alpha.M) | ||
| package: | ||
| type: choice | ||
| required: true | ||
| description: The package to publish. | ||
| options: | ||
| - iota-sdk | ||
| - iota-sdk-crypto | ||
| - iota-sdk-graphql-client | ||
| - iota-sdk-graphql-client-build | ||
| - iota-sdk-transaction-builder | ||
| - iota-sdk-types | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Setup for publish to crates.io | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
Thoralf-M marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Install cargo-release | ||
| run: cargo install cargo-release --version 0.25.20 | ||
|
|
||
| - name: Dry run publish | ||
| run: eval "cargo release -p ${{inputs.package}} --allow-branch develop,sdk-bindings --no-confirm --all-features" | ||
|
|
||
| - name: Get commits since last tag | ||
| run: eval "cargo release changes" | ||
|
|
||
| - name: Bump versions | ||
| run: eval "cargo release version -p ${{inputs.package}} --allow-branch develop,sdk-bindings --no-confirm ${{inputs.level}}" | ||
|
|
||
| - name: Commit packages | ||
| run: eval "cargo release commit --allow-branch develop,sdk-bindings --no-confirm" | ||
|
|
||
| - name: Tag commit | ||
| run: eval "cargo release tag -p ${{inputs.package}} --allow-branch develop,sdk-bindings --no-confirm --tag-prefix '${{inputs.package}}-'" | ||
|
|
||
| - name: Push commit | ||
| run: eval "cargo release push -p ${{inputs.package}} --allow-branch develop,sdk-bindings --no-confirm" | ||
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,28 @@ | ||
| name: Publish | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| publish: | ||
| name: Publish to crates.io | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - run: cargo install cargo-release --version 0.25.20 | ||
|
|
||
| - name: Cargo release publish | ||
| run: | | ||
| pkg=$(echo "${{github.event.release.tag_name}}" | sed -nr 's|(.*)-v.*|\1|p' | ||
| version=$(echo "${{github.event.release.tag_name}}" | sed -nr 's|.*-v(.*)|\1|p' | ||
|
|
||
| echo "Publishing $pkg at version $version" | ||
| eval "cargo release publish \ | ||
| -p $pkg \ | ||
Thoralf-M marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --all-features \ | ||
| --allow-branch develop,sdk-bindings \ | ||
| --no-confirm \ | ||
| --execute" | ||
Alex6323 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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,37 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "*-v*.*.*" | ||
Thoralf-M marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # We need this to be able to create releases. | ||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
|
|
||
| - name: Show the tag | ||
| run: | | ||
| echo "tag is: ${{ github.ref_name }}" | ||
thibault-martinez marked this conversation as resolved.
Show resolved
Hide resolved
thibault-martinez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Install node | ||
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | ||
|
|
||
| - name: Install conventional-commits | ||
| run: npm -g i conventional-commits | ||
|
|
||
| - name: Generate Release Notes | ||
| run: | | ||
| pkg=$(echo "${{github.ref_name}}" | sed -nr 's|(.*)-v.*|\1|p' | ||
| conventional-changelog -p conventionalcommits -i notes-${{ github.ref_name }}.md -s --commit-path "crates/$pkg" | ||
|
|
||
| - name: Create GitHub release | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: gh release create ${{ github.ref_name }} --verify-tag --title ${{ github.ref_name }} --draft --notes-file notes-${{ github.ref_name }}.md | ||
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
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.