From 49e4a1a43b1ae9c53bedbcee4fc7a522336fc2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sat, 19 Sep 2026 18:15:17 +0200 Subject: [PATCH 1/3] Add a release target that raises the version --- .github/workflows/release-prepare.yml | 90 --------------------------- Makefile | 19 +++++- 2 files changed, 18 insertions(+), 91 deletions(-) delete mode 100644 .github/workflows/release-prepare.yml diff --git a/.github/workflows/release-prepare.yml b/.github/workflows/release-prepare.yml deleted file mode 100644 index 0d5ce53..0000000 --- a/.github/workflows/release-prepare.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Prepare a release - -on: - workflow_dispatch: - inputs: - bump: - description: Which part of the version to raise - type: choice - required: true - default: patch - options: [major, minor, patch] - -permissions: - contents: write - pull-requests: write - -concurrency: - group: release-prepare - cancel-in-progress: false - -jobs: - prepare: - name: Open the version bump pull request - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BUMP: ${{ inputs.bump }} - steps: - - uses: actions/checkout@v4 - - - name: Compute the new version - id: version - run: | - current="$(sed -n 's/^;; Version: \(.*\)$/\1/p' magit-standup.el)" - IFS=. read -r major minor patch <<< "${current}" - case "${BUMP}" in - major) major=$((major + 1)); minor=0; patch=0 ;; - minor) minor=$((minor + 1)); patch=0 ;; - patch) patch=$((patch + 1)) ;; - *) echo "Unknown bump: ${BUMP}" >&2; exit 1 ;; - esac - new="${major}.${minor}.${patch}" - echo "current=${current}" >> "${GITHUB_OUTPUT}" - echo "new=${new}" >> "${GITHUB_OUTPUT}" - - - name: Check that the release branch is free - env: - NEW: ${{ steps.version.outputs.new }} - run: | - if git ls-remote --exit-code --heads origin "release/v${NEW}" >/dev/null 2>&1; then - echo "The branch release/v${NEW} already exists. Delete it and run again." >&2 - exit 1 - fi - - - name: Raise the version - env: - NEW: ${{ steps.version.outputs.new }} - run: | - sed -i "s/^;; Version: .*/;; Version: ${NEW}/" magit-standup.el - sed -i "2s/\"[0-9][0-9.]*\"/\"${NEW}\"/" Easkfile - grep -qx ";; Version: ${NEW}" magit-standup.el - grep -qx " \"${NEW}\"" Easkfile - git --no-pager diff - - - name: Commit the raised version - env: - NEW: ${{ steps.version.outputs.new }} - run: | - actor_id="$(gh api "users/${GITHUB_ACTOR}" --jq '.id')" - actor_name="$(gh api "users/${GITHUB_ACTOR}" --jq '.name // .login')" - export GIT_AUTHOR_NAME="${actor_name}" - export GIT_AUTHOR_EMAIL="${actor_id}+${GITHUB_ACTOR}@users.noreply.github.com" - export GIT_COMMITTER_NAME="github-actions[bot]" - export GIT_COMMITTER_EMAIL="41898282+github-actions[bot]@users.noreply.github.com" - git switch -c "release/v${NEW}" - git commit -am "Bump the version to ${NEW}" - git --no-pager log -1 --format='author: %an <%ae>%ncommitter: %cn <%ce>' - git push -u origin "release/v${NEW}" - - - name: Open the pull request - env: - CURRENT: ${{ steps.version.outputs.current }} - NEW: ${{ steps.version.outputs.new }} - run: | - gh pr create \ - --base main \ - --head "release/v${NEW}" \ - --label chore \ - --title "Bump the version to ${NEW}" \ - --body "This pull request raises the version from ${CURRENT} to ${NEW}. When you merge it, a workflow creates the tag v${NEW} and publishes the release with the generated notes." diff --git a/Makefile b/Makefile index 83c5dc8..71c932b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: lint test clean +.PHONY: lint test clean release .deps: Easkfile eask install-deps @@ -17,3 +17,20 @@ test: .compile clean: eask clean all @rm -f .deps .compile + +release: lint test + @test -n "$(VERSION)" || { echo "Give the version: make release VERSION=x.y.z"; exit 1; } + @git diff --quiet HEAD || { echo "Commit your changes first."; exit 1; } + git switch -c release/v$(VERSION) + sed 's/^;; Version: .*/;; Version: $(VERSION)/' magit-standup.el > magit-standup.el.new + mv magit-standup.el.new magit-standup.el + sed '2s/"[0-9][0-9.]*"/"$(VERSION)"/' Easkfile > Easkfile.new + mv Easkfile.new Easkfile + @grep -qx ";; Version: $(VERSION)" magit-standup.el + @grep -qx ' "$(VERSION)"' Easkfile + git commit -am "Bump the version to $(VERSION)" + @echo + @echo "Next:" + @echo " git push -u origin release/v$(VERSION)" + @echo " gh pr create --fill --label chore" + @echo "Merge it, and the workflow makes the tag and the release." From 2663f22df6a8b06ed1c0e019d0fdee6648d600f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sat, 19 Sep 2026 18:16:06 +0200 Subject: [PATCH 2/3] Document the release steps --- README.org | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.org b/README.org index 525de57..edf1f86 100644 --- a/README.org +++ b/README.org @@ -83,6 +83,26 @@ git log --format='%aN <%aE>' -1 The variable =magit-standup-author= (singular) still works, but it is obsolete since version 0.2.0. Use =magit-standup-authors= instead. +* Release + +To make a release, run: + +#+begin_src shell +make release VERSION=0.3.0 +#+end_src + +The target runs the linter and the tests. Then it creates the branch +=release/v0.3.0= and commits the new version. Push the branch and open +a pull request: + +#+begin_src shell +git push -u origin release/v0.3.0 +gh pr create --fill --label chore +#+end_src + +When you merge the pull request, a workflow creates the tag and +publishes the release with the generated notes. + * License GPL-3.0-or-later From b706ba8be7eeb0492d0bb2d8a9dbbf44676aed0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KARASZI=20Istv=C3=A1n?= Date: Sat, 19 Sep 2026 18:17:09 +0200 Subject: [PATCH 3/3] Keep the version bumps out of the changelog --- .github/release.yml | 2 ++ Makefile | 2 +- README.org | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 9cc2790..9b359d5 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,4 +1,6 @@ changelog: + exclude: + labels: [release] categories: - title: Features labels: [feat] diff --git a/Makefile b/Makefile index 71c932b..e622828 100644 --- a/Makefile +++ b/Makefile @@ -32,5 +32,5 @@ release: lint test @echo @echo "Next:" @echo " git push -u origin release/v$(VERSION)" - @echo " gh pr create --fill --label chore" + @echo " gh pr create --fill --label release" @echo "Merge it, and the workflow makes the tag and the release." diff --git a/README.org b/README.org index edf1f86..8f65dc3 100644 --- a/README.org +++ b/README.org @@ -97,7 +97,7 @@ a pull request: #+begin_src shell git push -u origin release/v0.3.0 -gh pr create --fill --label chore +gh pr create --fill --label release #+end_src When you merge the pull request, a workflow creates the tag and