diff --git a/.github/workflows/release.yml b/.github/workflows/create-release-pr.yml similarity index 53% rename from .github/workflows/release.yml rename to .github/workflows/create-release-pr.yml index ff346370..51cd03f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/create-release-pr.yml @@ -1,9 +1,9 @@ -name: Create a new GitHub Release +name: Create a Release Pull Request on: workflow_dispatch: inputs: - tag: + bump-type: description: "The type of version bump" required: true type: choice @@ -13,10 +13,10 @@ on: - "patch" jobs: - release: + create-release-pr: runs-on: ubuntu-latest env: - TAG: ${{ github.event.inputs.tag }} + BUMP_TYPE: ${{ github.event.inputs.bump-type }} steps: - name: Checkout @@ -27,37 +27,35 @@ jobs: with: python-version: 3.11 - - name: Install requirements + - name: Install release requirements run: pip install scriv bump-my-version - - name: Install pandoc for scriv - run: sudo apt install -y pandoc - - - name: Set up Git + - name: Configure Git user run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Get current and new version + - name: Compute version bump id: version run: | echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT - echo "NEW_VERSION=$(bump-my-version show --increment $TAG new_version)" >> $GITHUB_OUTPUT + echo "NEW_VERSION=$(bump-my-version show --increment $BUMP_TYPE new_version)" >> $GITHUB_OUTPUT - name: Bump version - run: bump-my-version bump $TAG + run: bump-my-version bump $BUMP_TYPE - name: Collect changelog run: make changelog - - name: Commit changes and create tag - uses: stefanzweifel/git-auto-commit-action@v5 + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 with: - branch: ${{ github.ref }} - commit_message: "chore: bump version ${{ steps.version.outputs.CURRENT_VERSION }} → ${{ steps.version.outputs.NEW_VERSION }}" - tagging_message: "v${{ steps.version.outputs.NEW_VERSION }}" - - - name: Create GitHub release - run: scriv github-release --repo=openedx/openedx-filters - env: - GITHUB_TOKEN: ${{ github.token }} + commit-message: "chore: bump version ${{ steps.version.outputs.CURRENT_VERSION }} → ${{ steps.version.outputs.NEW_VERSION }}" + title: "v${{ steps.version.outputs.NEW_VERSION }} Release" + body: | + ### Description + + This PR bumps the version from `${{ steps.version.outputs.CURRENT_VERSION }}` to `${{ steps.version.outputs.NEW_VERSION }}`. + + The changelog has been automatically generated using `scriv`. + branch: "release-${{ steps.version.outputs.NEW_VERSION }}" diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml new file mode 100644 index 00000000..d3d47c05 --- /dev/null +++ b/.github/workflows/github-release.yml @@ -0,0 +1,45 @@ +name: Create a new GitHub Release + +on: + workflow_dispatch: + +jobs: + github-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install release requirements + run: pip install scriv bump-my-version + + - name: Install pandoc for scriv + run: sudo apt install -y pandoc + + - name: Configure Git user + run: | + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + + - name: Read current version + id: version + run: | + echo "CURRENT_VERSION=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT + + - name: Create and push Git tag + env: + CURRENT_VERSION: ${{ steps.version.outputs.CURRENT_VERSION }} + run: | + git tag -a "v$CURRENT_VERSION" -m "Release v$CURRENT_VERSION" + git push origin "v$CURRENT_VERSION" + + - name: Create GitHub release + run: scriv github-release --repo=openedx/openedx-filters + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/changelog.d/20250326_102750_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_102750_bryann.valderrama_add_changelog_entries.rst index 3a1e81dd..d8a91fb5 100644 --- a/changelog.d/20250326_102750_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_102750_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Added ~~~~~ -* New documentation section with naming suggestions for creating filters. (by @mariajgrimaldi) +* New documentation section with naming suggestions for creating filters. (by @mariajgrimaldi in #264) diff --git a/changelog.d/20250326_103610_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_103610_bryann.valderrama_add_changelog_entries.rst index 5e4e1fd2..055c9cc8 100644 --- a/changelog.d/20250326_103610_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_103610_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Changed ~~~~~~~ -* Updated documentation titles and styles to follow the Open edX style guide. (by @Apgomeznext) +* Updated documentation titles and styles to follow the Open edX style guide. (by @Apgomeznext in #262 and #263) diff --git a/changelog.d/20250326_104004_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_104004_bryann.valderrama_add_changelog_entries.rst index 803180f5..706703d4 100644 --- a/changelog.d/20250326_104004_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_104004_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Changed ~~~~~~~ -* Updated the glossary section in the documentation. (by @Apgomeznext) +* Updated the glossary section in the documentation. (by @Apgomeznext in #266) diff --git a/changelog.d/20250326_104238_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_104238_bryann.valderrama_add_changelog_entries.rst index a8ae8a9f..f5f520f1 100644 --- a/changelog.d/20250326_104238_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_104238_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Changed ~~~~~~~ -* Improved how-to guides including updates to filters, samples, and formatting. (by @mariajgrimaldi) +* Improved how-to guides including updates to filters, samples, and formatting. (by @mariajgrimaldi in #260) diff --git a/changelog.d/20250326_110813_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_110813_bryann.valderrama_add_changelog_entries.rst index 18d5dec8..aabfc96c 100644 --- a/changelog.d/20250326_110813_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_110813_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Changed ~~~~~~~ -* Updated edX RTD link to Open edX RTD. (by @sarina) +* Updated edX RTD link to Open edX RTD. (by @sarina in #269) diff --git a/changelog.d/20250326_111322_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_111322_bryann.valderrama_add_changelog_entries.rst index cba26a0b..5629749f 100644 --- a/changelog.d/20250326_111322_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_111322_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Changed ~~~~~~~ -* Replaced the deprecated ``pydocstyle`` library with ``ruff``. (by @bryanttv) +* Replaced the deprecated ``pydocstyle`` library with ``ruff``. (by @bryanttv in #270) diff --git a/changelog.d/20250326_111517_bryann.valderrama_add_changelog_entries.rst b/changelog.d/20250326_111517_bryann.valderrama_add_changelog_entries.rst index 397249f3..bdf27671 100644 --- a/changelog.d/20250326_111517_bryann.valderrama_add_changelog_entries.rst +++ b/changelog.d/20250326_111517_bryann.valderrama_add_changelog_entries.rst @@ -1,3 +1,3 @@ Added ~~~~~ -* Migrate to ``scriv`` for manage changelog. (by @bryanttv) +* Migrate to ``scriv`` for manage changelog. (by @bryanttv in #268) diff --git a/changelog.d/20250414_123943_bryann.valderrama_update_release_workflow.rst b/changelog.d/20250414_123943_bryann.valderrama_update_release_workflow.rst new file mode 100644 index 00000000..ff02c9b6 --- /dev/null +++ b/changelog.d/20250414_123943_bryann.valderrama_update_release_workflow.rst @@ -0,0 +1,4 @@ +Changed +~~~~~~~ +* Update ``release.yml`` workflow to create PR with release changes. (by @bryanttv in #284) +* Update ``new_fragment.rst.j2`` template to include PR number in the changes. (by @bryanttv in #284) diff --git a/changelog.d/scriv/new_fragment.rst.j2 b/changelog.d/scriv/new_fragment.rst.j2 index ca8d581e..caedcc97 100644 --- a/changelog.d/scriv/new_fragment.rst.j2 +++ b/changelog.d/scriv/new_fragment.rst.j2 @@ -2,9 +2,11 @@ .. Please respect the following instructions: .. * Add a new bullet item for the category that best describes the change. -.. * You may optionally append "(by @)" at the end of the bullet item, -.. where @ is the GitHub username of the author of the change. These -.. affiliations will be displayed in the release notes for every release. +.. * You may optionally append "(by @ in #)" at the end of +.. the bullet item. This will be used to credit the PR author in the bullet +.. item, where is the GitHub username of the author of the change +.. and is the PR number of the change. These affiliations will +.. be displayed in the release notes for every release. .. * The accepted categories are: Added, Changed, Deprecated, Removed, Fixed, .. and Security. .. * Indicate breaking changes with a "**BREAKING CHANGE:**" prefix in the @@ -15,29 +17,29 @@ .. Added .. ~~~~~ .. * Added new ``CourseAccessFilter`` for controlling course content access. -.. * Added support for asynchronous filter execution. (by @developer) +.. * Added support for asynchronous filter execution. (by @developer in #1) .. Changed .. ~~~~~~~ .. * Improved filter pipeline performance. -.. * **BREAKING CHANGE:** Restructured filter response format for better consistency. (by @developer) +.. * **BREAKING CHANGE:** Restructured filter response format for better consistency. (by @developer in #2) .. Deprecated .. ~~~~~~~~~~ .. * Deprecated legacy filter registration method. -.. * Deprecated old filter pipeline format. (by @developer) +.. * Deprecated old filter pipeline format. (by @developer in #3) .. Removed .. ~~~~~~~ .. * Removed deprecated v1 filter interfaces. -.. * Removed support for synchronous-only filters. (by @developer) +.. * Removed support for synchronous-only filters. (by @developer in #4) .. Fixed .. ~~~~~ .. * Fixed memory leak in long-running filter chains. -.. * Fixed incorrect exception handling in filter pipeline. (by @developer) +.. * Fixed incorrect exception handling in filter pipeline. (by @developer in #5) .. Security .. ~~~~~~~~ .. * Enhanced filter input validation. -.. * Updated filter execution permissions model. (by @developer) +.. * Updated filter execution permissions model. (by @developer in #6)