Skip to content

Commit 76f91b0

Browse files
committed
ci(release): fix docs versioning for release candidates in workflow
Updates the release workflow to correctly set documentation version and changelog URLs for release candidate versions, ensuring they use the 'v{major}.{minor}.x' format instead of the full version number.
1 parent 682377f commit 76f91b0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,10 @@ jobs:
117117
run: |
118118
VERSION=${{ needs.pre_config.outputs.version }}
119119
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
120-
PATCH_VERSION=${VERSION##*.}
121-
if [[ $PATCH_VERSION =~ ^[0-9]+$ ]]; then
122-
DOCS_VERSION="v$VERSION"
120+
if [[ $VERSION == *-rc* ]]; then
121+
DOCS_VERSION="v${MAJOR_MINOR_VERSION}.x"
123122
else
124-
DOCS_VERSION="v$MAJOR_MINOR_VERSION.x"
123+
DOCS_VERSION="v$VERSION"
125124
fi
126125
curl --location --request PATCH "https://readthedocs.org/api/v3/projects/pycord/versions/$DOCS_VERSION/" \
127126
--header 'Content-Type: application/json' \
@@ -140,7 +139,11 @@ jobs:
140139
run: |
141140
VERSION=${{ needs.pre_config.outputs.version }}
142141
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
143-
DOCS_URL="<https://docs.pycord.dev/en/v$VERSION/changelog.html>"
142+
if [[ $VERSION == *-rc* ]]; then
143+
DOCS_URL="<https://docs.pycord.dev/en/v${MAJOR_MINOR_VERSION}.x/changelog.html>"
144+
else
145+
DOCS_URL="<https://docs.pycord.dev/en/v$VERSION/changelog.html>"
146+
fi
144147
GITHUB_COMPARE_URL="<https://github.com/Pycord-Development/pycord/compare/${{ needs.pre_config.outputs.previous_tag }}...v$VERSION>"
145148
GITHUB_RELEASE_URL="<https://github.com/Pycord-Development/pycord/releases/tag/v$VERSION>"
146149
PYPI_RELEASE_URL="<https://pypi.org/project/py-cord/$VERSION/>"

0 commit comments

Comments
 (0)