Skip to content

Commit 4ca6420

Browse files
authored
[ci skip] chore: release prep/2.7.0 rc.1 (#2888)
* fix: Update changelog for old v2.6.1 release Changed the unreleased comparison link to reference v2.6.1 and added a link for the v2.6.1 release in the changelog. * Update milestone determination logic in release workflow Removes the '.0' suffix check from the milestone job condition and dynamically calculates the previous major.minor version for milestone queries. This improves flexibility and correctness in milestone handling during releases. * Add version branch creation to release workflow The release workflow now conditionally creates and checks out the version branch if it does not exist, ensuring releases are made from the correct branch. Also, remote-release.yml is now ignored in .gitignore.
1 parent ea7f21a commit 4ca6420

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,19 @@ jobs:
7070
with:
7171
fetch-depth: 0
7272
fetch-tags: true
73-
73+
- name: "Create version branch if missing"
74+
id: conditional-create-version-branch
75+
shell: bash
76+
env:
77+
VERSION_BRANCH: ${{ needs.pre_config.outputs.branch_name }}
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
run: |
80+
git fetch origin
81+
if ! git show-ref --verify --quiet refs/heads/$VERSION_BRANCH; then
82+
git checkout -b $VERSION_BRANCH
83+
git push origin $VERSION_BRANCH
84+
fi
85+
git checkout $VERSION_BRANCH
7486
- name: "Release Pycord"
7587
id: pycord-release
7688
uses: Aiko-IT-Systems/[email protected]
@@ -145,7 +157,7 @@ jobs:
145157
determine_milestone_id:
146158
runs-on: ubuntu-latest
147159
needs: [lib_release,pre_config]
148-
if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }}
160+
if: ${{ !contains(needs.pre_config.outputs.version, '-') }}
149161
outputs:
150162
old_milestone_version: ${{ steps.extract_version.outputs.old_milestone_version }}
151163
new_milestone_version: ${{ steps.extract_version.outputs.new_milestone_version }}
@@ -158,7 +170,8 @@ jobs:
158170
run: |
159171
gh extension install valeriobelli/gh-milestone
160172
VERSION=${{ needs.pre_config.outputs.version }}
161-
OLD_MILESTONE_VERSION=$(gh milestone list --query "v2.7" | grep "#" | awk '{print $2}')
173+
PREV_MAJOR_MINOR=$(echo $VERSION | awk -F. '{printf "v%d.%d", $1, $2-1}')
174+
OLD_MILESTONE_VERSION=$(gh milestone list --query "$PREV_MAJOR_MINOR" | grep "#" | awk '{print $2}')
162175
NEW_MILESTONE_VERSION="v$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')"
163176
echo "old_milestone_version=$OLD_MILESTONE_VERSION" >> $GITHUB_OUTPUT
164177
echo "new_milestone_version=$NEW_MILESTONE_VERSION" >> $GITHUB_OUTPUT

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,4 @@ docs/build/linkcheck
193193
!docs/locales/*
194194
/build/
195195
/vscode/
196+
remote-release.yml

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,8 @@ These changes are available on the `master` branch, but have not yet been releas
10921092
- Fix py3.10 UnionType checks issue.
10931093
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))
10941094

1095-
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...HEAD
1095+
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.1...HEAD
1096+
[2.6.1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.6.1
10961097
[2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...v2.6.0
10971098
[2.5.0]: https://github.com/Pycord-Development/pycord/compare/v2.4.1...v2.5.0
10981099
[2.4.1]: https://github.com/Pycord-Development/pycord/compare/v2.4.0...v2.4.1

0 commit comments

Comments
 (0)