From ec0125c2eeae7cd41f91495e8599f51f28a0a3ed Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 8 Apr 2024 14:35:38 +0200 Subject: [PATCH 1/2] Towards better release procedure - Prepare release commit (CHANGELOG), triple-check and push. - Wait for CI to finish. - Tag locally and push. - Tadaaa! --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5720968 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Create Release + +on: + push: + tags: [ 'v*' ] + +jobs: + release: + # Avoid forks to perform this job. + if: github.repository_owner == 'moodlehq' + name: Create Release + runs-on: ubuntu-22.04 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Extract release notes from changelog + id: extract-release-notes + uses: yashanand1910/standard-release-notes@v1.5.0 + with: + changelog_path: ./CHANGELOG.md + version: ${{ github.ref }} + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + body: | + ${{ steps.extract-release-notes.outputs.release_notes }} + # + Take a look at the [CHANGELOG](https://github.com/moodlehq/moodle-cs/blob/main/CHANGELOG.md) for details about other releases. From c8830705b4be6dd7b2d3c2daa5f7cd8b2287ae30 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Wed, 10 Apr 2024 11:03:45 +0200 Subject: [PATCH 2/2] Add some docs explaining the release process Also, unrelated, fix a link to point to new phpcs repo. --- README.md | 2 +- docs/ReleaseNewVersion.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 docs/ReleaseNewVersion.md diff --git a/README.md b/README.md index c2251d1..b3a9c47 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## Information -This repository contains the Moodle Coding Style configurations, written as [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) rulesets. +This repository contains the Moodle Coding Style configurations, written as [PHP CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) rulesets. Two coding styles are included: diff --git a/docs/ReleaseNewVersion.md b/docs/ReleaseNewVersion.md new file mode 100644 index 0000000..e1c0dfe --- /dev/null +++ b/docs/ReleaseNewVersion.md @@ -0,0 +1,34 @@ +# Releasing a new version + +This is a guide on how to release a new version of this project. Remember that +when considering the version number to use, that this project follows +[Semantic Versioning](http://semver.org/), so bump the version number accordingly. + +Also, note that, for the logs, we follow the [Keep a CHANGELOG](https://keepachangelog.com) +format (sections order, lists, ...) as much as possible. + +Prior to tagging a release, ensure the following have been updated: + +* The `CHANGELOG.md` needs to be up-to-date. In addition, the _Unreleased_ section + needs to be updated with the version being released. Also update the _Unreleased_ + link at the bottom with the new version number and add the new link there. + +When all the changes above have been performed and triple-checked, +**create a commit** (*"Prepare for vX.Y.Z release"*) and +**push it straight upstream** to `main`. + +Once all code and commits are in place and verified, you need to tag a +release. Tag `main` branch `HEAD` and push using commands (don't forget the +leading "`v`"): + +```bash +$ git tag -a vX.Y.Z -m "Release version vX.Y.Z" +$ git push origin vX.Y.Z +``` + +When the tag is pushed, GitHub release workflow will be triggered. Verify it has worked +correctly by navigating at [Releases](https://github.com/moodlehq/moodle-cs/releases). + +While in that page, optionally, you can edit the release and add any content +to the description, though **it's not recommended** because that may lead to +double release notifications here and there.