Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SKIPCI] fix release pipeline #18

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/actions/create-release/gh-release-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const myArgs = process.argv.slice(2);
const pJson = require(`${myArgs[0]}/package.json`)

const version = pJson.version;
const repoName = pJson.name;
const repoName = pJson.name;

const packageName = repoName.split('/');

Expand All @@ -21,7 +21,7 @@ function checkForBetaVersion(version) {
function gatherReleaseInfo(logPath) {
const changeLogs = fs.readFileSync(logPath, 'utf8');
const regex = /## \[([0-9]+(\.[0-9]+)+)] - [0-9]{4}-[0-9]{2}-[0-9]{2}/i;

let lines = changeLogs.split(/\n/);
let foundChangelog = false;
let releaseInfo = '';
Expand All @@ -32,7 +32,7 @@ function gatherReleaseInfo(logPath) {
i = j;
j = lines.length;
foundChangelog = true;
}
}
}

lines = lines.slice(i);
Expand All @@ -42,21 +42,21 @@ function gatherReleaseInfo(logPath) {
if(j == 0){
releaseInfo += `${lines[j]}`+ '\n';
continue;
}
}

if(!regex.test(lines[j])){
releaseInfo += `${lines[j]}`+ '\n';
} else {
j = lines.length;
}
}
}

if(releaseInfo === ''){
core.setFailed("No release info found, either missing in changelog or changelog is formatted incorrectly")
}

console.log("Gathered release info...")
console.log("Gathered release info...")
return releaseInfo;
}

Expand All @@ -68,17 +68,17 @@ async function publishRelease(releaseInfo) {
},
owner: 'subquery',
name: `[${version}] ${repoName}`,
repo: 'subql-ethereum',
repo: 'subql-starknet',
tag_name: `${packageName[1]}/${version}`,
target_commitish: `${myArgs[1]}`,
body: releaseInfo
}).catch( err => {
core.setFailed(err)
})

console.log("Release Created...")
console.log("Release Created...")
}

checkForBetaVersion(version);

const releaseInfo = gatherReleaseInfo(`${myArgs[0]}/CHANGELOG.md`);
Expand Down
Loading