-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate to semantic-release 24
- Loading branch information
1 parent
a57ef3b
commit d26ca87
Showing
18 changed files
with
6,684 additions
and
2,344 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 @@ | ||
_ |
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,4 @@ | ||
#!/bin/sh | ||
# . "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit "$1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
#!/usr/bin/env node | ||
|
||
const utils = require('../utils'); | ||
const path = require('path'); | ||
const validateConfig = require('../validateConfig'); | ||
const config = require(path.resolve('package.json')); | ||
const branch = process.env.TRAVIS_BRANCH || process.env.GIT_LOCAL_BRANCH || utils.ghActionsBranch(process.env); | ||
import { ghActionsBranch } from '../utils.js'; | ||
import { resolve } from 'path'; | ||
import validateConfig from '../validateConfig.js'; | ||
const config = require(resolve('package.json')); | ||
const branch = process.env.TRAVIS_BRANCH || process.env.GIT_LOCAL_BRANCH || ghActionsBranch(process.env); | ||
const branchTags = config.release && config.release.branchTags; | ||
const tag = branchTags && branchTags[branch]; | ||
const dryRun = process.argv.find(arg => /^(--dry-run|-n)$/.test(arg)); | ||
const publicPackage = process.argv.find(arg => /^(--public)$/.test(arg)); | ||
const validate = process.argv.find(arg => /^(--validate|-v)$/.test(arg)); | ||
const command = [ 'npm', 'publish' ]; | ||
const command = ['npm', 'publish']; | ||
|
||
if (validate) { | ||
validateConfig(config); | ||
return; | ||
} | ||
validateConfig(config); | ||
// return; | ||
} else { | ||
if (tag) { | ||
command.push('--tag', tag); | ||
} | ||
|
||
if (tag) { | ||
command.push('--tag', tag); | ||
} | ||
if (publicPackage) { | ||
command.push('--access=public'); | ||
} | ||
|
||
if (publicPackage) { | ||
command.push('--access=public'); | ||
} | ||
if (!branchTags) { | ||
console.warn('[WARN] No branch tag configuration'); | ||
} | ||
|
||
if (!branchTags) { | ||
console.warn('[WARN] No branch tag configuration'); | ||
} | ||
|
||
if (dryRun) { | ||
console.log(command.join(' ')); | ||
} else { | ||
const exec = require('child_process').exec; | ||
exec(command.join(' '), function(error, stdout, stderr) { | ||
console.log(stdout); | ||
if (dryRun) { | ||
console.log(command.join(' ')); | ||
} else { | ||
const exec = require('child_process').exec; | ||
exec(command.join(' '), function (error, stdout, stderr) { | ||
console.log(stdout); | ||
|
||
if (error) { | ||
console.error(`[ERROR] npm publish: ${stderr}`); | ||
process.exit(1); | ||
} | ||
}); | ||
if (error) { | ||
console.error(`[ERROR] npm publish: ${stderr}`); | ||
process.exit(1); | ||
} | ||
}); | ||
} | ||
} |
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,3 @@ | ||
export default { | ||
extends: ["@commitlint/config-conventional"], | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
const execSync = require('child_process').execSync; | ||
import { execSync } from 'child_process'; | ||
|
||
const lastTag = ({ branch = 'origin/master', dev = true } = {}) => { | ||
export const lastTag = ({ branch = 'origin/master', dev = true } = {}) => { | ||
const exclude = dev ? ' --exclude="*dev*"' : ''; | ||
return execSync(`git describe --tags --match "v[0-9]*" ${exclude} --abbrev=0 ${branch} || true`, | ||
{ encoding: 'utf8' } | ||
).trim(); | ||
}; | ||
|
||
module.exports = lastTag; | ||
} |
Oops, something went wrong.