Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/pre_publish.yml
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:
- 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"
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
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 \
--all-features \
--allow-branch develop,sdk-bindings \
--no-confirm \
--execute"
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
tags:
- "*-v*.*.*"

# 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 }}"

- 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
2 changes: 1 addition & 1 deletion crates/iota-sdk-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pem = [
bls12381 = ["dep:blst", "dep:rand_core", "dep:roaring", "signature/std"]

[dependencies]
iota-types = { version = "0.0.1", package = "iota-sdk-types", path = "../iota-sdk-types", default-features = false, features = ["hash", "serde"] }
iota-types = { workspace = true, features = ["hash", "serde"] }
signature = "2.2"
thiserror.workspace = true

Expand Down