From 2ba6c33fec953ecf5123e2aa2dffaa5e97eae0dc Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 8 Jul 2024 13:06:37 -0700 Subject: [PATCH 1/4] Use the builtin `GITHUB_TOKEN`. --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dbd8637..dc86b49 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,8 +6,10 @@ jobs: runs-on: ubuntu-latest environment: deploy name: deploy + permissions: + contents: write env: - gh_token: ${{ secrets.GH_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v3 - name: jdk 11 From b19a5a5f45ef8788fe841c57e5e90a5bc4ff38ee Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 8 Jul 2024 13:12:35 -0700 Subject: [PATCH 2/4] Add `tagMessage` and `runAfterPush 'gh release xxx'`. --- src/main/resources/base/changelog.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/base/changelog.gradle b/src/main/resources/base/changelog.gradle index 4011b8e..d783414 100644 --- a/src/main/resources/base/changelog.gradle +++ b/src/main/resources/base/changelog.gradle @@ -31,6 +31,8 @@ if (tasks.names.contains('changelogCheck')) { spotlessChangelog { branch 'release' appendDashSnapshotUnless_dashPrelease = true + tagMessage '{{changes}}' + runAfterPush "gh release create release/{{version}} --title 'v{{version}}' --notes-from-tag" } // set the project version for POM, jar manifest, etc. version = spotlessChangelog.versionNext From 5d2efbb1b0be799763f88fc86bba18721b9f10cc Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 8 Jul 2024 13:21:58 -0700 Subject: [PATCH 3/4] Automatically merge `release` into `main` and push it. --- .github/workflows/deploy.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index dc86b49..69f27e8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -19,5 +19,9 @@ jobs: distribution: 'temurin' - name: gradle caching uses: gradle/gradle-build-action@v2 + - run: git fetch origin main - name: publish all - run: ./gradlew changelogPush -Prelease=true -Penable_publishing=true --stacktrace --warning-mode all \ No newline at end of file + run: ./gradlew changelogPush -Prelease=true -Penable_publishing=true --stacktrace --warning-mode all + - run: git checkout main + - run: git merge release --ff-only + - run: git push origin main \ No newline at end of file From 0099585846f839fd9364f1144e84ff4615049563 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Mon, 8 Jul 2024 13:29:06 -0700 Subject: [PATCH 4/4] Update changelog. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index dcc4eef..543b3e0 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,11 @@ # Changelog ## [Unreleased] +### Changed +- **BREAKING** `spotlessChangelog` now creates GitHub releases by default ([#6](https://github.com/diffplug/blowdryer-diffplug/pull/6)) + - you need to update your `deploy.yml` + - if you set the `tagPrefix`, then you'll need to update the `runAfterPush` + - see PR above for details ## [7.3.0] - 2024-06-06 ### Added