diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d40ba74308..2a336a03a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,7 +70,19 @@ jobs: with: fetch-depth: 0 fetch-tags: true - + - name: "Create version branch if missing" + id: conditional-create-version-branch + shell: bash + env: + VERSION_BRANCH: ${{ needs.pre_config.outputs.branch_name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git fetch origin + if ! git show-ref --verify --quiet refs/heads/$VERSION_BRANCH; then + git checkout -b $VERSION_BRANCH + git push origin $VERSION_BRANCH + fi + git checkout $VERSION_BRANCH - name: "Release Pycord" id: pycord-release uses: Aiko-IT-Systems/pycord-lib-release-action@v1.0.0 @@ -145,7 +157,7 @@ jobs: determine_milestone_id: runs-on: ubuntu-latest needs: [lib_release,pre_config] - if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }} + if: ${{ !contains(needs.pre_config.outputs.version, '-') }} outputs: old_milestone_version: ${{ steps.extract_version.outputs.old_milestone_version }} new_milestone_version: ${{ steps.extract_version.outputs.new_milestone_version }} @@ -158,7 +170,8 @@ jobs: run: | gh extension install valeriobelli/gh-milestone VERSION=${{ needs.pre_config.outputs.version }} - OLD_MILESTONE_VERSION=$(gh milestone list --query "v2.7" | grep "#" | awk '{print $2}') + PREV_MAJOR_MINOR=$(echo $VERSION | awk -F. '{printf "v%d.%d", $1, $2-1}') + OLD_MILESTONE_VERSION=$(gh milestone list --query "$PREV_MAJOR_MINOR" | grep "#" | awk '{print $2}') NEW_MILESTONE_VERSION="v$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')" echo "old_milestone_version=$OLD_MILESTONE_VERSION" >> $GITHUB_OUTPUT echo "new_milestone_version=$NEW_MILESTONE_VERSION" >> $GITHUB_OUTPUT diff --git a/.gitignore b/.gitignore index 66c2218ef3..2eefa244cd 100644 --- a/.gitignore +++ b/.gitignore @@ -193,3 +193,4 @@ docs/build/linkcheck !docs/locales/* /build/ /vscode/ +remote-release.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8329420262..f30bbd71d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1092,7 +1092,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fix py3.10 UnionType checks issue. ([#1240](https://github.com/Pycord-Development/pycord/pull/1240)) -[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...HEAD +[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.1...HEAD +[2.6.1]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...v2.6.1 [2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...v2.6.0 [2.5.0]: https://github.com/Pycord-Development/pycord/compare/v2.4.1...v2.5.0 [2.4.1]: https://github.com/Pycord-Development/pycord/compare/v2.4.0...v2.4.1