Skip to content

Commit a78687d

Browse files
committed
docs: make release on rc/** branches possible (#50)
Signed-off-by: Mariusz Jasuwienas <jasuwienas@gmail.com>
1 parent 423a9ab commit a78687d

2 files changed

Lines changed: 27 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ jobs:
6161
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
6262
run: |
6363
PROCEED="true"
64+
SEMREL_OUTPUT=""
65+
# Default branch release
6466
if [[ "${{ github.event.repository.default_branch }}" == "${{ github.ref_name }}" ]]; then
65-
if SEMREL_OUTPUT=$(npx semantic-release --dry-run 2>&1); then
67+
if SEMREL_OUTPUT=$( (cd contracts && npx semantic-release --dry-run) 2>&1 ); then
6668
if echo "${SEMREL_OUTPUT}" | grep -q "The next release version is"; then
6769
echo "::notice file=flow-deploy-release-artifact.yaml::Semantic Release detected a new version"
6870
else
@@ -73,9 +75,19 @@ jobs:
7375
echo "::notice file=flow-deploy-release-artifact.yaml::Semantic Release did NOT run successfully"
7476
PROCEED="false"
7577
fi
76-
echo "::group::SemVer output"
77-
echo "${SEMREL_OUTPUT}"
78-
echo "::endgroup::"
78+
# RC prerelease on branches like rc/*
79+
elif [[ "${{ github.ref_name }}" == rc/* ]]; then
80+
if SEMREL_OUTPUT=$( (cd contracts && npx semantic-release --dry-run) 2>&1 ); then
81+
if echo "${SEMREL_OUTPUT}" | grep -q "The next release version is"; then
82+
echo "::notice file=flow-deploy-release-artifact.yaml::Semantic Release detected a new RC version for branch ${{ github.ref_name }}"
83+
else
84+
echo "::notice file=flow-deploy-release-artifact.yaml::Semantic Release detected NO RC version for branch ${{ github.ref_name }}"
85+
PROCEED="false"
86+
fi
87+
else
88+
echo "::notice file=flow-deploy-release-artifact.yaml::Semantic Release did NOT run successfully on RC branch"
89+
PROCEED="false"
90+
fi
7991
else
8092
if [[ "${{ inputs.dry-run-enabled }}" == "true" ]]; then
8193
jq -r '.version' './package.json' > VERSION
@@ -85,6 +97,12 @@ jobs:
8597
fi
8698
fi
8799
100+
if [[ -n "${SEMREL_OUTPUT}" ]]; then
101+
echo "::group::SemVer output"
102+
echo "${SEMREL_OUTPUT}"
103+
echo "::endgroup::"
104+
fi
105+
88106
echo "need-release=${PROCEED}" >> "${GITHUB_OUTPUT}"
89107
90108
- name: Extract version

contracts/.releaserc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
branches: ["main", "release/x", { "name": "50-rc-1", "prerelease": "rc" }],
2+
branches: [
3+
"main",
4+
"release/x",
5+
{ "name": "rc/*", "prerelease": "rc" }
6+
],
37
tagFormat: "v${version}",
48
plugins: [
59
[

0 commit comments

Comments
 (0)