Skip to content

Commit

Permalink
feat(core): upgrade semantic-release to version v20 (juliuscc#104)
Browse files Browse the repository at this point in the history
This PR proposes the bump of such version and allow our users to be able to include and use the latest version of semantic-release library and it's features in their applications.

fixes juliuscc#103

BREAKING CHANGE: We only support v18+ of Node and v20+ of semantic-release now. semantic-release library introduced a new version v20 which introduces several breaking changes, including but not limited Node v18 as requirement. More information can be found [here](https://github.com/semantic-release/semantic-release/releases/tag/v20.0.0).
  • Loading branch information
Saeger authored Mar 2, 2023
1 parent e7d1c4d commit 54ee3bd
Show file tree
Hide file tree
Showing 6 changed files with 20,093 additions and 4,232 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:14.17.0
- image: cimg/node:18.3.0
steps:
- checkout
- restore_cache:
Expand All @@ -16,7 +16,7 @@ jobs:
- ./node_modules
test:
docker:
- image: circleci/node:14.17.0
- image: cimg/node:18.3.0
steps:
- checkout
- restore_cache:
Expand All @@ -29,7 +29,7 @@ jobs:
command: npm test
deploy:
docker:
- image: circleci/node:14.17.0
- image: cimg/node:18.3.0
steps:
- checkout
- restore_cache:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Add the plugin to your npm-project:
$ npm install semantic-release-slack-bot -D
```

## Requirements

As per the new release of semantic-release library version 20, the library is requiring the use of Node v18, which we need to comply as well to use keep the repo updated with it's latest feature. More information can be found [here](https://github.com/semantic-release/semantic-release/releases/tag/v20.0.0).

## Slack App/Webhook Usage

The corresponding slack app has to be installed in your slack workspace as well. Follow the instructions under [configuration](#configuration) for more information.
Expand Down Expand Up @@ -198,9 +202,7 @@ const { chunkifyString } = require('semantic-release-slack-bot/lib/chunkifier')

const onSuccessFunction = (pluginConfig, context) => {
const releaseNotes = slackifyMarkdown(context.nextRelease.notes)
const text = `Updates to ${
pluginConfig.packageName
} has been released to *Stage!*`
const text = `Updates to ${pluginConfig.packageName} has been released to *Stage!*`
const headerBlock = {
type: 'section',
text: {
Expand Down
8 changes: 2 additions & 6 deletions lambda/create-webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ exports.handler = function(event, context) {

const optionspost = {
host: 'slack.com',
path: `/api/oauth.access?client_id=${client_id}&client_secret=${client_secret}&code=${
event.queryStringParameters.code
}`,
path: `/api/oauth.access?client_id=${client_id}&client_secret=${client_secret}&code=${event.queryStringParameters.code}`,
method: 'GET'
}

Expand All @@ -39,9 +37,7 @@ exports.handler = function(event, context) {
context.succeed({
statusCode: 301,
headers: {
Location: `https://juliuscc.github.io/semantic-release-slack-bot/index.html?access_token=${
jsonStr.access_token
}`
Location: `https://juliuscc.github.io/semantic-release-slack-bot/index.html?access_token=${jsonStr.access_token}`
}
})
} else {
Expand Down
8 changes: 2 additions & 6 deletions lib/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ module.exports = async (pluginConfig, context) => {
type: 'section',
text: {
type: 'mrkdwn',
text: `A new version of \`${package_name}\` has been released!\nCurrent version is *${
nextRelease.version
}*`
text: `A new version of \`${package_name}\` has been released!\nCurrent version is *${nextRelease.version}*`
}
}
]
Expand Down Expand Up @@ -108,9 +106,7 @@ module.exports = async (pluginConfig, context) => {
elements: [
{
type: 'mrkdwn',
text: `:package: *<${repo.URL}|${
repo.path
}>:* <${gitTagUrl}|${gitTag}>`
text: `:package: *<${repo.URL}|${repo.path}>:* <${gitTagUrl}|${gitTag}>`
}
]
}
Expand Down
Loading

0 comments on commit 54ee3bd

Please sign in to comment.