mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
Merge pull request #171 from enell/node20
feat: update node version to 20
This commit is contained in:
commit
31a37a4689
8 changed files with 4667 additions and 2603 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -48,7 +48,7 @@ jobs:
|
||||||
- name: Setup Node.js with GitHub Package Registry
|
- name: Setup Node.js with GitHub Package Registry
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
scope: 'cycjimmy'
|
scope: 'cycjimmy'
|
||||||
|
|
||||||
|
|
|
||||||
26
README.md
26
README.md
|
|
@ -20,7 +20,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
@ -63,7 +63,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
semantic_version: 19.0.5 # It is recommended to specify a version range
|
semantic_version: 19.0.5 # It is recommended to specify a version range
|
||||||
# for semantic-release when using
|
# for semantic-release when using
|
||||||
|
|
@ -73,9 +73,7 @@ steps:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
```
|
```
|
||||||
|
|
||||||
If no version range is specified with `cycjimmy/semantic-release-action@v3` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [19.0.5](https://github.com/semantic-release/semantic-release/releases/tag/v19.0.5) is used. Earlier versions of `cycjimmy/semantic-release-action` default to using the latest version of [semantic-release](https://github.com/semantic-release/semantic-release/), so in this case it is recommended to specify version 19 or lower to avoid compatibility issues.
|
If no version range is specified with `cycjimmy/semantic-release-action@v4` then [semantic-release](https://github.com/semantic-release/semantic-release/) version [21.1.1](https://github.com/semantic-release/semantic-release/releases/tag/v21.1.1) is used.
|
||||||
|
|
||||||
*Note: [Version 20.0.0](https://github.com/semantic-release/semantic-release/releases/tag/v20.0.0) of [semantic-release](https://github.com/semantic-release/semantic-release/) and later is currently incompatible with `cycjimmy/semantic-release-action`, since it requires Node.js 18. GitHub does not provide this environment yet for [JavaScript actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-javascript-actions).*
|
|
||||||
|
|
||||||
#### branches
|
#### branches
|
||||||
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
|
> {Optional Input Parameter} The branches on which releases should happen.<br>`branches` supports for **semantic-release above v16**.
|
||||||
|
|
@ -85,7 +83,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
semantic_version: 16
|
semantic_version: 16
|
||||||
# you can set branches for semantic-release above v16.
|
# you can set branches for semantic-release above v16.
|
||||||
|
|
@ -131,7 +129,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
semantic_version: 15.13.28
|
semantic_version: 15.13.28
|
||||||
# you can set branch for semantic-release older than v16.
|
# you can set branch for semantic-release older than v16.
|
||||||
|
|
@ -156,7 +154,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
# You can specify specifying version range for the extra plugins if you prefer.
|
# You can specify specifying version range for the extra plugins if you prefer.
|
||||||
extra_plugins: |
|
extra_plugins: |
|
||||||
|
|
@ -186,7 +184,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
dry_run: true
|
dry_run: true
|
||||||
env:
|
env:
|
||||||
|
|
@ -202,7 +200,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
ci: false
|
ci: false
|
||||||
env:
|
env:
|
||||||
|
|
@ -220,7 +218,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
# You can extend an existing shareable configuration.
|
# You can extend an existing shareable configuration.
|
||||||
# And you can specify version range for the shareable configuration if you prefer.
|
# And you can specify version range for the shareable configuration if you prefer.
|
||||||
|
|
@ -240,7 +238,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
# You can select another working directory like a subdirectory for example.
|
# You can select another working directory like a subdirectory for example.
|
||||||
working_directory: ./code
|
working_directory: ./code
|
||||||
|
|
@ -257,7 +255,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
with:
|
with:
|
||||||
tag_format: custom-v${version}
|
tag_format: custom-v${version}
|
||||||
env:
|
env:
|
||||||
|
|
@ -287,7 +285,7 @@ steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Semantic Release
|
- name: Semantic Release
|
||||||
uses: cycjimmy/semantic-release-action@v3
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
id: semantic # Need an `id` for output variables
|
id: semantic # Need an `id` for output variables
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -58,5 +58,5 @@ outputs:
|
||||||
last_release_git_tag:
|
last_release_git_tag:
|
||||||
description: 'The Git tag associated with the last release, if there was one.'
|
description: 'The Git tag associated with the last release, if there was one.'
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|
|
||||||
7226
package-lock.json
generated
7226
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -22,9 +22,9 @@
|
||||||
"homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
|
"homepage": "https://github.com/cycjimmy/semantic-release-action#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@cycjimmy/awesome-js-funcs": "^4.0.4",
|
"@cycjimmy/awesome-js-funcs": "^4.0.9",
|
||||||
"@semantic-release/changelog": "^6.0.3",
|
"@semantic-release/changelog": "^6.0.3",
|
||||||
"@semantic-release/git": "^10.0.1",
|
"@semantic-release/git": "^10.0.1",
|
||||||
"semantic-release": "^19.0.5"
|
"semantic-release": "^21.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ exports.handleBranchesOption = () => {
|
||||||
*/
|
*/
|
||||||
exports.handleDryRunOption = () => {
|
exports.handleDryRunOption = () => {
|
||||||
const dryRun = core.getInput(inputs.dry_run);
|
const dryRun = core.getInput(inputs.dry_run);
|
||||||
|
core.debug(`dryRun input: ${dryRun}`);
|
||||||
|
|
||||||
switch (dryRun) {
|
switch (dryRun) {
|
||||||
case 'true':
|
case 'true':
|
||||||
|
|
@ -66,6 +67,7 @@ exports.handleDryRunOption = () => {
|
||||||
*/
|
*/
|
||||||
exports.handleCiOption = () => {
|
exports.handleCiOption = () => {
|
||||||
const ci = core.getInput(inputs.ci);
|
const ci = core.getInput(inputs.ci);
|
||||||
|
core.debug(`ci input: ${ci}`);
|
||||||
|
|
||||||
switch (ci) {
|
switch (ci) {
|
||||||
case 'true':
|
case 'true':
|
||||||
|
|
@ -85,6 +87,7 @@ exports.handleCiOption = () => {
|
||||||
*/
|
*/
|
||||||
exports.handleExtends = () => {
|
exports.handleExtends = () => {
|
||||||
const extend = core.getInput(inputs.extends);
|
const extend = core.getInput(inputs.extends);
|
||||||
|
core.debug(`extend input: ${extend}`);
|
||||||
|
|
||||||
if (extend) {
|
if (extend) {
|
||||||
const extendModuleNames = extend.split(/\r?\n/)
|
const extendModuleNames = extend.split(/\r?\n/)
|
||||||
|
|
@ -103,6 +106,7 @@ exports.handleExtends = () => {
|
||||||
*/
|
*/
|
||||||
exports.handleTagFormat = () => {
|
exports.handleTagFormat = () => {
|
||||||
const tagFormat = core.getInput(inputs.tag_format);
|
const tagFormat = core.getInput(inputs.tag_format);
|
||||||
|
core.debug(`citagFormat input: ${tagFormat}`);
|
||||||
|
|
||||||
if (tagFormat) {
|
if (tagFormat) {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@ const release = async () => {
|
||||||
await preInstall(core.getInput(inputs.extra_plugins));
|
await preInstall(core.getInput(inputs.extra_plugins));
|
||||||
await preInstall(core.getInput(inputs.extends));
|
await preInstall(core.getInput(inputs.extends));
|
||||||
|
|
||||||
const semanticRelease = require('semantic-release');
|
const semanticRelease = await import('semantic-release');
|
||||||
const result = await semanticRelease({
|
const result = await semanticRelease.default({
|
||||||
...handleBranchesOption(),
|
...handleBranchesOption(),
|
||||||
...handleDryRunOption(),
|
...handleDryRunOption(),
|
||||||
...handleCiOption(),
|
...handleCiOption(),
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ module.exports = async (result) => {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
const {lastRelease, commits, nextRelease, releases} = result;
|
const {lastRelease, commits, nextRelease, releases} = await result;
|
||||||
|
|
||||||
if (lastRelease.version) {
|
if (lastRelease.version) {
|
||||||
core.debug(`The last release was "${lastRelease.version}".`);
|
core.debug(`The last release was "${lastRelease.version}".`);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue