mirror of
https://github.com/certd/certd.git
synced 2026-05-18 14:27:36 +08:00
chore: publish
This commit is contained in:
@@ -7,7 +7,9 @@ export function getVersionContent() {
|
||||
const changelog = fs.readFileSync('./CHANGELOG.md', 'utf8')
|
||||
// 解析CHANGELOG.md
|
||||
let lines = changelog.split('\n')
|
||||
const versionLineIndex = lines.findIndex(line => line.startsWith('## '))
|
||||
const versionLineIndex = lines.findIndex(line => {
|
||||
return line.startsWith('## [') || line.startsWith('# [')
|
||||
})
|
||||
const versionLine = lines[versionLineIndex]
|
||||
// ## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||
const versionTitle = versionLine.match(/\[(.*?)\]/)[1]
|
||||
|
||||
@@ -152,6 +152,7 @@ async function uploadFile(url, headers, data) {
|
||||
|
||||
async function publishToAtomgit() {
|
||||
const { versionTitle, content } = getVersionContent()
|
||||
try{
|
||||
const release = await createRelease(versionTitle, content)
|
||||
const uploadUrl = await getUploadUrl(versionTitle)
|
||||
const fileName = `./packages/ui/certd-client/ui.zip`
|
||||
@@ -161,6 +162,14 @@ async function publishToAtomgit() {
|
||||
const response = await uploadFile(uploadUrl.url, uploadUrl.headers, fileData)
|
||||
console.log("uploadFile success:")
|
||||
console.log("publishToAtomgit success")
|
||||
}catch(error){
|
||||
if (error?.response?.data){
|
||||
console.log("publishToAtomgit error:",error.response.data)
|
||||
}else{
|
||||
console.log("publishToAtomgit error:",error)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
publishToAtomgit()
|
||||
@@ -33,7 +33,11 @@ async function publishToGitee() {
|
||||
const release = await createRelease(versionTitle, content)
|
||||
console.log("publishToGitee success")
|
||||
} catch (error) {
|
||||
console.error("publishToGitee error:", error)
|
||||
if (error?.response?.data){
|
||||
console.log("publishToGitee error:",error.response.data)
|
||||
}else{
|
||||
console.log("publishToGitee error:",error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
10
|
||||
11
|
||||
|
||||
Reference in New Issue
Block a user