From ae1ae30d35e30506cf53cf4384bbfb439e80a42e Mon Sep 17 00:00:00 2001 From: Johann Pardanaud Date: Thu, 26 Dec 2024 12:36:02 +0100 Subject: [PATCH] wip --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++---- CONTRIBUTING.md | 10 ++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd7bd3c..8d87eb6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ env: jobs: create-release-pr: - name: Create a Pull Request for the release + name: Create a pull request for the release runs-on: ubuntu-latest steps: @@ -21,7 +21,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - # This token allows committing modifications on workflow files (read/write on Contents and Workflows permissions) + # This token allows committing modifications on workflow files (read/write on Contents, Pull Requests, and Workflows permissions) token: ${{ secrets.RELEASE_TOKEN }} - name: Write a new release to CHANGELOG.md @@ -49,10 +49,33 @@ jobs: # The tail command is used to remove an unnecessary title from the changelog. run: chan show $RELEASE_VERSION | tail -n +2 | gh release create $RELEASE_VERSION --title "Akkurate $RELEASE_VERSION" --draft --notes-file - - - name: Create a Pull Request + - name: Create a pull request env: GH_TOKEN: ${{ secrets.RELEASE_TOKEN }} - run: gh pr create --assignee nesk --base main --head release/$RELEASE_VERSION --title "Release $RELEASE_VERSION" --body "New release" -d + run: | + gh pr create --assignee nesk --base main --head release/$RELEASE_VERSION --title "Release $RELEASE_VERSION" --body "This a pull request for releasing version $RELEASE_VERSION of Akkurate. + + ### Before merging this pull-request + #### Maven Central Repository + Head to the [Nexus Repository Manager](https://s01.oss.sonatype.org/#stagingRepositories) and verify if the newly created staging repository is valid, meaning: + + - all the artifacts are present (root directories starting with `akkurate-` in the sources); + - each artifact is built for nearly [all multiplatform targets](https://kotlinlang.org/docs/multiplatform-dsl-reference.html#targets); + - and all the files are signed with multiple `.asc` variations. + + If everything is compliant to this checklist, close the repository, then release it. + + #### GitHub release + Open the draft release created on GitHub. You can edit the description of the release to add any additional content you want, _but leave the changelog as-is._ Once you're satisfied, publish the release. + + #### Finalize everything + Once everything above is done, you can merge this pull request. + + ### Aborting the release + In case you want to cancel everything and restart from a clean slate: + + - Delete the tag and the branch: `git push --delete origin $RELEASE_VERSION release/$RELEASE_VERSION` + - Delete the release: `gh release delete $RELEASE_VERSION`" publish: name: Publish to Maven Central Repository diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 433c43e..4beac48 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,3 +21,13 @@ If you're fixing a bug, create a new test reproducing the bug to avoid future re New code should be tested with a significant code coverage score (you can check it by using **Run | Run with Coverage** in IntelliJ). + +## Releasing + +The release process is almost entirely automated. You only have to +trigger [the release workflow](.github/workflows/release.yml) +and then follow the instructions of the created pull request. + +```shell +gh workflow run release.yml -f version=1.2.3 +```