generated from okp4/template-rust
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #672 from axone-protocol/ci/publish
Ci/publish
- Loading branch information
Showing
17 changed files
with
278 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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 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,44 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
tags: ["v*"] | ||
|
||
concurrency: | ||
group: publish-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
publish-crates: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache cargo registry | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
~/.cargo/bin | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- name: Setup rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: 1.75 | ||
default: true | ||
override: true | ||
|
||
- name: Install cargo make | ||
uses: davidB/rust-cargo-make@v1 | ||
|
||
- name: Publish crates to crates.io | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
run: | | ||
cargo make publish-crates |
This file contains 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,118 @@ | ||
module.exports = { | ||
branches: ["main"], | ||
plugins: [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
preset: "conventionalcommits", | ||
releaseRules: [ | ||
{ type: "build", scope: "deps", release: "patch" }, | ||
{ type: "build", scope: "deps-dev", release: "patch" }, | ||
{ type: "refactor", release: "patch" }, | ||
{ type: "style", release: "patch" }, | ||
{ type: "ci", release: "patch" }, | ||
{ type: "chore", release: "patch" }, | ||
{ type: "docs", release: "patch" }, | ||
{ breaking: true, release: "major" }, | ||
], | ||
}, | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
preset: "conventionalcommits", | ||
}, | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
changelogFile: "CHANGELOG.md", | ||
changelogTitle: "# AXONE contracts", | ||
}, | ||
], | ||
[ | ||
"semantic-release-replace-plugin", | ||
{ | ||
replacements: [ | ||
{ | ||
files: ["Cargo.toml"], | ||
from: /^version\s+=\s+"\d+\.\d+\.\d+"$/gm, | ||
to: 'version = "${nextRelease.version}"', | ||
countMatches: true, | ||
results: [ | ||
{ | ||
file: "Cargo.toml", | ||
hasChanged: true, | ||
numMatches: 1, | ||
numReplacements: 1, | ||
}, | ||
], | ||
}, | ||
{ | ||
files: ["Cargo.toml"], | ||
from: /((axone-[\w-]+)\s*=\s*\{\s*path\s*=\s*"\.\/[^"]*",\s+version\s+=\s+)"\d+\.\d+\.\d+"/g, | ||
to: ( | ||
_match, | ||
prefix, | ||
_dependencyName, | ||
_path, | ||
_extra, | ||
_version, | ||
context | ||
) => `${prefix}"${context.nextRelease.version}"`, | ||
countMatches: true, | ||
results: [ | ||
{ | ||
file: "Cargo.toml", | ||
hasChanged: true, | ||
numMatches: 7, | ||
numReplacements: 7, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
prepareCmd: | ||
"cargo make schema && cargo make docs-generate && cargo make release-wasm", | ||
}, | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
successComment: false, | ||
assets: [ | ||
{ path: "./artifacts/axone_objectarium.wasm" }, | ||
{ path: "./artifacts/axone_law_stone.wasm" }, | ||
{ path: "./artifacts/axone_cognitarium.wasm" }, | ||
{ path: "./artifacts/axone_dataverse.wasm" }, | ||
{ path: "./artifacts/checksums.txt" }, | ||
{ | ||
path: "./contracts/axone-objectarium/schema/axone-objectarium.json", | ||
}, | ||
{ path: "./contracts/axone-law-stone/schema/axone-law-stone.json" }, | ||
{ | ||
path: "./contracts/axone-cognitarium/schema/axone-cognitarium.json", | ||
}, | ||
{ path: "./contracts/axone-dataverse/schema/axone-dataverse.json" }, | ||
], | ||
}, | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
assets: [ | ||
"CHANGELOG.md", | ||
"contracts/*/Cargo.toml", | ||
"packages/*/Cargo.toml", | ||
"docs/**", | ||
"Cargo.lock", | ||
], | ||
message: "chore(release): perform release ${nextRelease.version}", | ||
}, | ||
], | ||
], | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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
Oops, something went wrong.