|
| 1 | +module.exports = { |
| 2 | + branches: ["main"], |
| 3 | + plugins: [ |
| 4 | + [ |
| 5 | + "@semantic-release/commit-analyzer", |
| 6 | + { |
| 7 | + preset: "conventionalcommits", |
| 8 | + releaseRules: [ |
| 9 | + { type: "build", scope: "deps", release: "patch" }, |
| 10 | + { type: "build", scope: "deps-dev", release: "patch" }, |
| 11 | + { type: "refactor", release: "patch" }, |
| 12 | + { type: "style", release: "patch" }, |
| 13 | + { type: "ci", release: "patch" }, |
| 14 | + { type: "chore", release: "patch" }, |
| 15 | + { type: "docs", release: "patch" }, |
| 16 | + { breaking: true, release: "major" }, |
| 17 | + ], |
| 18 | + }, |
| 19 | + ], |
| 20 | + [ |
| 21 | + "@semantic-release/release-notes-generator", |
| 22 | + { |
| 23 | + preset: "conventionalcommits", |
| 24 | + }, |
| 25 | + ], |
| 26 | + [ |
| 27 | + "@semantic-release/changelog", |
| 28 | + { |
| 29 | + changelogFile: "CHANGELOG.md", |
| 30 | + changelogTitle: "# AXONE contracts", |
| 31 | + }, |
| 32 | + ], |
| 33 | + [ |
| 34 | + "semantic-release-replace-plugin", |
| 35 | + { |
| 36 | + replacements: [ |
| 37 | + { |
| 38 | + files: ["Cargo.toml"], |
| 39 | + from: /^version\s+=\s+"\d+\.\d+\.\d+"$/gm, |
| 40 | + to: 'version = "${nextRelease.version}"', |
| 41 | + countMatches: true, |
| 42 | + results: [ |
| 43 | + { |
| 44 | + file: "Cargo.toml", |
| 45 | + hasChanged: true, |
| 46 | + numMatches: 1, |
| 47 | + numReplacements: 1, |
| 48 | + }, |
| 49 | + ], |
| 50 | + }, |
| 51 | + { |
| 52 | + files: ["Cargo.toml"], |
| 53 | + from: /((axone-[\w-]+)\s*=\s*\{\s*path\s*=\s*"\.\/[^"]*",\s+version\s+=\s+)"\d+\.\d+\.\d+"/g, |
| 54 | + to: ( |
| 55 | + _match, |
| 56 | + prefix, |
| 57 | + _dependencyName, |
| 58 | + _path, |
| 59 | + _extra, |
| 60 | + _version, |
| 61 | + context |
| 62 | + ) => `${prefix}"${context.nextRelease.version}"`, |
| 63 | + countMatches: true, |
| 64 | + results: [ |
| 65 | + { |
| 66 | + file: "Cargo.toml", |
| 67 | + hasChanged: true, |
| 68 | + numMatches: 7, |
| 69 | + numReplacements: 7, |
| 70 | + }, |
| 71 | + ], |
| 72 | + }, |
| 73 | + ], |
| 74 | + }, |
| 75 | + ], |
| 76 | + [ |
| 77 | + "@semantic-release/exec", |
| 78 | + { |
| 79 | + prepareCmd: |
| 80 | + "cargo make schema && cargo make docs-generate && cargo make release-wasm", |
| 81 | + }, |
| 82 | + ], |
| 83 | + [ |
| 84 | + "@semantic-release/github", |
| 85 | + { |
| 86 | + successComment: false, |
| 87 | + assets: [ |
| 88 | + { path: "./artifacts/axone_objectarium.wasm" }, |
| 89 | + { path: "./artifacts/axone_law_stone.wasm" }, |
| 90 | + { path: "./artifacts/axone_cognitarium.wasm" }, |
| 91 | + { path: "./artifacts/axone_dataverse.wasm" }, |
| 92 | + { path: "./artifacts/checksums.txt" }, |
| 93 | + { |
| 94 | + path: "./contracts/axone-objectarium/schema/axone-objectarium.json", |
| 95 | + }, |
| 96 | + { path: "./contracts/axone-law-stone/schema/axone-law-stone.json" }, |
| 97 | + { |
| 98 | + path: "./contracts/axone-cognitarium/schema/axone-cognitarium.json", |
| 99 | + }, |
| 100 | + { path: "./contracts/axone-dataverse/schema/axone-dataverse.json" }, |
| 101 | + ], |
| 102 | + }, |
| 103 | + ], |
| 104 | + [ |
| 105 | + "@semantic-release/git", |
| 106 | + { |
| 107 | + assets: [ |
| 108 | + "CHANGELOG.md", |
| 109 | + "contracts/*/Cargo.toml", |
| 110 | + "packages/*/Cargo.toml", |
| 111 | + "docs/**", |
| 112 | + "Cargo.lock", |
| 113 | + ], |
| 114 | + message: "chore(release): perform release ${nextRelease.version}", |
| 115 | + }, |
| 116 | + ], |
| 117 | + ], |
| 118 | +}; |
0 commit comments