1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-13 07:31:35 +02:00

test: add tests and configure CI/CD (#104)

This commit is contained in:
Benjamin E. Coe
2020-11-25 14:10:46 -05:00
committed by GitHub
parent 562cbbb631
commit fe20625bea
6 changed files with 1108 additions and 6 deletions

View File

@@ -25,7 +25,8 @@ async function main () {
// First we check for any merged release PRs (PRs merged with the label
// "autorelease: pending"):
if (!command || command === 'github-release') {
const gr = new GitHubRelease({
const Release = releasePlease.getGitHubRelease()
const gr = new Release({
label: RELEASE_LABEL,
repoUrl: process.env.GITHUB_REPOSITORY,
packageName,
@@ -45,7 +46,7 @@ async function main () {
// Next we check for PRs merged since the last release, and groom the
// release PR:
if (!command || command === 'release-pr') {
const release = ReleasePRFactory.buildStatic(releaseType, {
const release = releasePlease.getReleasePRFactory().buildStatic(releaseType, {
monorepoTags,
packageName,
path,
@@ -62,6 +63,24 @@ async function main () {
}
}
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`)
})
function getGitHubRelease () {
return GitHubRelease
}
function getReleasePRFactory () {
return ReleasePRFactory
}
const releasePlease = {
main,
getGitHubRelease,
getReleasePRFactory
}
if (require.main === module) {
main().catch(err => {
core.setFailed(`release-please failed: ${err.message}`)
})
} else {
module.exports = releasePlease
}