Skip to content

Commit 458a6e9

Browse files
committed
ci: allow commits during release automation
Problem: Commits to "master" branch will cause release automation to fail. This requires us to "freeze" mainline until the release completes. Solution: Before pushing, fetch from upstream. Then do a non-fast-forward merge if necessary.
1 parent 780c427 commit 458a6e9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

buildspec/release/40pushtogithub.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ phases:
3636
git commit -m "Update version to snapshot version: ${VERSION}-SNAPSHOT"
3737
- |
3838
if [ "$STAGE" != "prod" ]; then
39-
echo "Stage is not production, skipping github push step"
39+
echo "SKIPPED (stage=${STAGE}): 'git push originWithCreds ${TARGET_BRANCH}'"
4040
exit 0
4141
fi
4242
echo "pushing to github"
4343
git push originWithCreds --tags
44+
git fetch originWithCreds ${TARGET_BRANCH}
45+
git merge --no-edit -m "Merge release into ${TARGET_BRANCH}" FETCH_HEAD
4446
git push originWithCreds ${TARGET_BRANCH}

buildspec/release/50githubrelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ phases:
4141
# note: the tag arg passed here should match what is in 10changeversion.yml
4242
gh release create --repo $REPO --title "$PKG_DISPLAY_NAME $VERSION" --notes "$RELEASE_MESSAGE" -- "${TARGET_EXTENSION}/v${VERSION}" "$UPLOAD_TARGET" "$HASH_UPLOAD_TARGET"
4343
else
44-
echo "SKIPPED: 'gh release create --repo $REPO'"
44+
echo "SKIPPED (stage=${STAGE}): 'gh release create --repo $REPO'"
4545
fi

buildspec/release/60publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ phases:
2828
- |
2929
echo "Publishing to vscode marketplace: $UPLOAD_TARGET"
3030
if [ "$STAGE" != "prod" ]; then
31-
echo "skipped (stage=${STAGE})"
31+
echo "SKIPPED (stage=${STAGE}): 'npx vsce publish --pat xxx --packagePath ${UPLOAD_TARGET}'"
3232
else
3333
npx vsce publish --pat "$VS_MARKETPLACE_PAT" --packagePath "$UPLOAD_TARGET"
3434
fi
3535
- |
3636
echo "Publishing to openvsx marketplace: $UPLOAD_TARGET"
3737
if [ "$STAGE" != "prod" ]; then
38-
echo "skipped (stage=${STAGE})"
38+
echo "SKIPPED (stage=${STAGE}): 'npx --yes ovsx publish --pat xxx "${UPLOAD_TARGET}"'"
3939
else
40-
npx --yes ovsx publish "$UPLOAD_TARGET" -p "$OVSX_PAT"
40+
npx --yes ovsx publish --pat "$OVSX_PAT" "$UPLOAD_TARGET"
4141
fi

0 commit comments

Comments
 (0)