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

ci: add prerelease #2553

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion .deployment.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@
"no_endpoint": true
},
"package_rollout": {
"only_consider_changesets_after": "b244fe702d8e96d016a52715e92c8131acfde3ba"
"only_consider_changesets_after": "b244fe702d8e96d016a52715e92c8131acfde3ba",
"disabled": $[STOP_AT_DEV]
},
"deployment_config_version": 7
}
1 change: 1 addition & 0 deletions .github/workflows/masterbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- master
- 'prerelease/**'
jobs:
build:
name: 'Build'
Expand Down
32 changes: 21 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
def parseSemanticVersion(String version) {
def semanticVersionRegex = /^(((([0-9]+)\.[0-9]+)\.[0-9]+)(?:\-.+)?)$/
def (_, prerelease, patch, minor, major) = (version =~ semanticVersionRegex)[0]
return [major, minor, patch, prerelease]
}

node('heavy && linux && docker') {
checkout scm
def tag = sh(script: "git tag --contains", returnStdout: true).trim()
def isBump = !!tag
def isMaster = env.BRANCH_NAME == 'master'
def isOnReleaseBranch = env.BRANCH_NAME == 'master'
def isOnPrereleaseBranch = env.BRANCH_NAME.startsWith('prerelease/')

if (!isMaster) {
if (!isOnReleaseBranch && !isOnPrereleaseBranch) {
return
}

Expand Down Expand Up @@ -37,7 +44,11 @@ node('heavy && linux && docker') {
withCredentials([
string(credentialsId: 'NPM_TOKEN', variable: 'NPM_TOKEN')]) {
sh "echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc"
sh 'npm run npm:publish:alpha || true'
if (isOnReleaseBranch) {
sh 'npm run npm:publish:alpha || true'
} else {
sh 'npm run npm:publish || true'
}
}
}
}
Expand All @@ -48,23 +59,22 @@ node('heavy && linux && docker') {
headless = readJSON file: 'packages/headless/package.json'
atomic = readJSON file: 'packages/atomic/package.json'
atomicReact = readJSON file: 'packages/atomic-react/package.json'
semanticVersionRegex = /^([^\.]*)\.[^\.]*/

(headlessMinor, headlessMajor) = (headless.version =~ semanticVersionRegex)[0]
(atomicMinor, atomicMajor) = (atomic.version =~ semanticVersionRegex)[0]
(atomicReactMinor, atomicReactMajor) = (atomicReact.version =~ semanticVersionRegex)[0]

(headlessMajor, headlessMinor, headlessPatch) = parseSemanticVersion(headless.version)
(atomicMajor, atomicMinor, atomicPatch) = parseSemanticVersion(atomic.version)
(atomicReactMajor, atomicReactMinor, atomicReactPatch) = parseSemanticVersion(atomicReact)

sh "deployment-package package create --with-deploy \
--resolve HEADLESS_MAJOR_VERSION=${headlessMajor} \
--resolve HEADLESS_MINOR_VERSION=${headlessMinor} \
--resolve HEADLESS_PATCH_VERSION=${headless.version} \
--resolve HEADLESS_PATCH_VERSION=${headlessPatch} \
--resolve ATOMIC_MAJOR_VERSION=${atomicMajor} \
--resolve ATOMIC_MINOR_VERSION=${atomicMinor} \
--resolve ATOMIC_PATCH_VERSION=${atomic.version} \
--resolve ATOMIC_PATCH_VERSION=${atomicPatch} \
--resolve ATOMIC_REACT_MAJOR_VERSION=${atomicReactMajor} \
--resolve ATOMIC_REACT_MINOR_VERSION=${atomicReactMinor} \
--resolve ATOMIC_REACT_PATCH_VERSION=${atomicReact.version} \
--resolve ATOMIC_REACT_PATCH_VERSION=${atomicReactPatch} \
--resolve STOP_AT_DEV=${!isOnReleaseBranch} \
|| true"
}
}
Expand Down
Loading