mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
chore: publish
This commit is contained in:
@@ -7,7 +7,9 @@ export function getVersionContent() {
|
|||||||
const changelog = fs.readFileSync('./CHANGELOG.md', 'utf8')
|
const changelog = fs.readFileSync('./CHANGELOG.md', 'utf8')
|
||||||
// 解析CHANGELOG.md
|
// 解析CHANGELOG.md
|
||||||
let lines = changelog.split('\n')
|
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]
|
const versionLine = lines[versionLineIndex]
|
||||||
// ## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
// ## [1.37.16](https://github.com/certd/certd/compare/v1.37.15...v1.37.16) (2025-12-15)
|
||||||
const versionTitle = versionLine.match(/\[(.*?)\]/)[1]
|
const versionTitle = versionLine.match(/\[(.*?)\]/)[1]
|
||||||
|
|||||||
@@ -152,15 +152,24 @@ async function uploadFile(url, headers, data) {
|
|||||||
|
|
||||||
async function publishToAtomgit() {
|
async function publishToAtomgit() {
|
||||||
const { versionTitle, content } = getVersionContent()
|
const { versionTitle, content } = getVersionContent()
|
||||||
const release = await createRelease(versionTitle, content)
|
try{
|
||||||
const uploadUrl = await getUploadUrl(versionTitle)
|
const release = await createRelease(versionTitle, content)
|
||||||
const fileName = `./packages/ui/certd-client/ui.zip`
|
const uploadUrl = await getUploadUrl(versionTitle)
|
||||||
const fileData = fs.createReadStream(fileName)
|
const fileName = `./packages/ui/certd-client/ui.zip`
|
||||||
const contentLength = fs.statSync(fileName).size
|
const fileData = fs.createReadStream(fileName)
|
||||||
uploadUrl.headers['Content-Length'] = contentLength
|
const contentLength = fs.statSync(fileName).size
|
||||||
const response = await uploadFile(uploadUrl.url, uploadUrl.headers, fileData)
|
uploadUrl.headers['Content-Length'] = contentLength
|
||||||
console.log("uploadFile success:")
|
const response = await uploadFile(uploadUrl.url, uploadUrl.headers, fileData)
|
||||||
console.log("publishToAtomgit success")
|
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()
|
publishToAtomgit()
|
||||||
@@ -33,7 +33,11 @@ async function publishToGitee() {
|
|||||||
const release = await createRelease(versionTitle, content)
|
const release = await createRelease(versionTitle, content)
|
||||||
console.log("publishToGitee success")
|
console.log("publishToGitee success")
|
||||||
} catch (error) {
|
} 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