From 2d0e0eb7c77b7c40acd7a00111f82872e573be8b Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sun, 10 Mar 2024 13:32:09 +0100 Subject: [PATCH 1/5] Create release when tag is pushed --- .github/workflows/release.yaml | 39 ++++++++++++++++++++ build/scripts/extract-release-notes.php | 47 +++++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100755 build/scripts/extract-release-notes.php diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..2557ae9f --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +# https://docs.github.com/en/actions + +on: + push: + tags: + - "**" + +name: Release + +jobs: + release: + name: Release + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + coverage: none + extensions: none + tools: none + + - name: Determine tag + run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Parse ChangeLog + run: build/scripts/extract-release-notes.php ${{ env.RELEASE_TAG }} > release-notes.md + + - name: Create release + uses: ncipollo/release-action@v1 + with: + bodyFile: release-notes.md + tag: ${{ env.RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/build/scripts/extract-release-notes.php b/build/scripts/extract-release-notes.php new file mode 100755 index 00000000..39014398 --- /dev/null +++ b/build/scripts/extract-release-notes.php @@ -0,0 +1,47 @@ +#!/usr/bin/env php +' . PHP_EOL; + + exit(1); +} + +$version = $argv[1]; +$versionSeries = explode('.', $version)[0] . '.' . explode('.', $version)[1]; + +$file = __DIR__ . '/../../ChangeLog-' . $versionSeries . '.md'; + +if (!is_file($file) || !is_readable($file)) { + print $file . ' cannot be read' . PHP_EOL; + + exit(1); +} + +$buffer = ''; +$append = false; + +foreach (file($file) as $line) { + if (str_starts_with($line, '## [' . $version . ']')) { + $append = true; + + continue; + } + + if ($append && (str_starts_with($line, '## ') || str_starts_with($line, '['))) { + break; + } + + if ($append) { + $buffer .= $line; + } +} + +$buffer = trim($buffer); + +if ($buffer === '') { + print 'Unable to extract release notes' . PHP_EOL; + + exit(1); +} + +print $buffer . PHP_EOL; From 40ad9fed11f9f1ac8a8c8a6c1c9db90b3bd6ca37 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Mon, 11 Mar 2024 07:17:13 +0100 Subject: [PATCH 2/5] Allow write operations --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2557ae9f..6c4d83ab 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout uses: actions/checkout@v4 From 328a747f499cca790acff5634a4e55b957f40634 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Mon, 11 Mar 2024 07:17:15 +0100 Subject: [PATCH 3/5] Include package name in release name --- .github/workflows/release.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6c4d83ab..11111a6b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -37,6 +37,7 @@ jobs: - name: Create release uses: ncipollo/release-action@v1 with: - bodyFile: release-notes.md - tag: ${{ env.RELEASE_TAG }} token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.RELEASE_TAG }} + name: phpunit/php-code-coverage ${{ env.RELEASE_TAG }} + bodyFile: release-notes.md From 2681df11ccc4d3553c973ecf348acbdd0e7b7415 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 22 Aug 2024 06:22:56 +0200 Subject: [PATCH 4/5] Bump dependencies (so that users that install using Composer's --prefer-lowest CLI option also get recent versions) --- composer.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 4e3c0f6f..f9fd3613 100644 --- a/composer.json +++ b/composer.json @@ -33,15 +33,15 @@ "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { "phpunit/phpunit": "^9.6" From 85402a822d1ecf1db1096959413d35e1c37cf1a5 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Thu, 22 Aug 2024 06:23:01 +0200 Subject: [PATCH 5/5] Prepare release --- ChangeLog-9.2.md | 7 +++++++ src/Version.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog-9.2.md b/ChangeLog-9.2.md index 9ef6be33..5176ae33 100644 --- a/ChangeLog-9.2.md +++ b/ChangeLog-9.2.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [9.2.32] - 2024-08-22 + +### Changed + +* Updated dependencies (so that users that install using Composer's `--prefer-lowest` CLI option also get recent versions) + ## [9.2.31] - 2024-03-02 ### Changed @@ -511,6 +517,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * This component is no longer supported on PHP 7.1 +[9.2.32]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.31...9.2.32 [9.2.31]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.30...9.2.31 [9.2.30]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.29...9.2.30 [9.2.29]: https://github.com/sebastianbergmann/php-code-coverage/compare/9.2.28...9.2.29 diff --git a/src/Version.php b/src/Version.php index 1753a97b..93cf32d9 100644 --- a/src/Version.php +++ b/src/Version.php @@ -22,7 +22,7 @@ final class Version public static function id(): string { if (self::$version === null) { - self::$version = (new VersionId('9.2.31', dirname(__DIR__)))->getVersion(); + self::$version = (new VersionId('9.2.32', dirname(__DIR__)))->getVersion(); } return self::$version;