Skip to content

Commit

Permalink
fix: Releasing with semantic-release -e extending a js configuration … (
Browse files Browse the repository at this point in the history
#152)

Signed-off-by: Francisco Javier Ribó Labrador <[email protected]>
  • Loading branch information
elribonazo committed May 2, 2024
1 parent ce16926 commit 7354b0c
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 79 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ jobs:
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install dependencies
run: npm install

- name: Build project
run: npm run build
- uses: crazy-max/ghaction-import-gpg@v5
id: import_gpg
Expand All @@ -63,5 +57,8 @@ jobs:
GIT_COMMITTER_NAME: ${{ steps.import_gpg.outputs.name }}
run: |
npm install
npm run docs
RELEASE_CANDIDATE=${{ inputs.release_candidate}} npx semantic-release
if [[ "${{ inputs.release_candidate }}" == "true" ]]; then
npx semantic-release -e release-rc.config.js
else
npx semantic-release -e release.config.js
fi
10 changes: 10 additions & 0 deletions release-dev.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const baseConfig = require('./release.base.config');
module.exports = baseConfig({
branches: [
'master',
{
name: 'release/*',
prerelease: '${name.replace(/release\\/v/, "") + "-rc"}'
}
],
});
9 changes: 9 additions & 0 deletions release-prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const baseConfig = require('./release.base.config');
module.exports = baseConfig({
branches: [
'master',
{
name: 'release/*',
}
],
});
62 changes: 62 additions & 0 deletions release.base.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
module.exports = (extraConfig = {}) => (
{
...extraConfig,
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
['@semantic-release/changelog', { changelogFile: 'CHANGELOG.md' }],
[
'@semantic-release/exec',
{
prepareCmd: 'npm version ${nextRelease.version} --git-tag-version false',
},
],
[
'@semantic-release/exec',
{
prepareCmd: 'npm run build',
},
],
['@semantic-release/exec', { prepareCmd: 'npm publish --access public' }],
[
'@semantic-release/exec',
{
prepareCmd: 'npm run docs',
},
],
[
'@semantic-release/exec',
{
prepareCmd:
'yarn --cwd integration-tests/e2e-tests add @atala/prism-wallet-sdk@^${nextRelease.version}',
},
],
[
'@semantic-release/git',
{
assets: [
'package.json',
'package-lock.json',
'CHANGELOG.md',
'integration-tests/e2e-tests/package.json',
'integration-tests/e2e-tests/yarn.lock',
'docs/**/*',
],
message: 'chore(release): release ${nextRelease.version}\n\n${nextRelease.notes}',
},
],
[
'semantic-release-slack-bot',
{
notifyOnSuccess: true,
notifyOnFail: true,
markdownReleaseNotes: true,
onSuccessTemplate: {
text:
"A new version of `$package_name` successfully released!\nVersion: `$npm_package_version`\nTag: $repo_url/releases/tag/v$npm_package_version\n\nRelease notes:\n$release_notes",
},
},
],
],
}
);
71 changes: 0 additions & 71 deletions release.config.js

This file was deleted.

0 comments on commit 7354b0c

Please sign in to comment.