Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate release #110

Open
dodie opened this issue Aug 8, 2021 · 3 comments
Open

Automate release #110

dodie opened this issue Aug 8, 2021 · 3 comments
Labels

Comments

@dodie
Copy link
Owner

dodie commented Aug 8, 2021

Regular maintenance requires many manual steps:

  • Bump asm and javaparser dependencies to ensure that Scott can work with the latest Java.
  • Bump ASM constant in the visitors. (E.g. ASM7->ASM8)
  • Modify JUnit5 tests and build pipelines to run with latest Java
  • Add new tests for some new Java features
  • Run all test suites
  • Release a new version (doc), including:
    • Bump versions
    • Release artifacts to Maven Central
      • Upload artifacts
      • Manually approve staged artifacts on the Nexus UI
    • Release Gradle Plugin
    • Update version references in the documentation

Ideally, parts of this process should be handled by build pipelines.

@dodie dodie added the build label Aug 8, 2021
@dodie
Copy link
Owner Author

dodie commented Aug 8, 2021

Prerequisites

  • In the builds for the post-java-8 test suite always use a docker image with the latest Java version. (e.g. instead of the tag 3.6.3-jdk-14, just adoptopenjdk to use latest Maven and Java, or find a tag with a fixed Maven version.)

Automated pipelines

Bump dependency and Java versions

  • Triggered manually, or in a scheduled manner, e.g. every week.
  • Check if there's any change for the dependencies and if there's one, create a branch and open a PR.
    • Modify dependencies
      • Modify pom.xml: https://www.baeldung.com/maven-dependency-latest-version
        • Now all scott modules use the 3.7.0 version, and are bumped in each release. However, this is most likely not needed in many cases, e.g. for test modules. If it makes things simpler use a fix version in these cases.
      • Alternative idea: try to use dependabot, but in this case the other steps will be decoupled.
    • Modify the Java language levels in the JUnit5 test suites.

Prepare for release

  • Triggered manually with a new version parameter / no parameter, automatically bumps patch version.
  • Opens a PR with the bumped versions

Deploy

  • Triggered manually
  • Fail if the current version is already available on Maven Central.
  • Contains the appropriate secrets and runs the deployment to Maven Central and Gradle Plugin Portal.

Further ideas

  • Trigger release by a release/* tag to create a Release with the appropriate tag to start the pipeline, and maybe perform version bumping in one go.

@Aloren
Copy link

Aloren commented Sep 29, 2021

For automatic dependency updates you can use: https://github.com/apps/renovate
For publishing releases you can use Github actions: https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven
And for the changelog automation you can use: https://github.com/release-drafter/release-drafter

Hope, this helps :)

@dodie
Copy link
Owner Author

dodie commented Sep 29, 2021

Thanks for the tips @Aloren ! Renovate looks really cool, I did not know about it. Migrating the build from Azure Pipelines to GitHub Actions also makes sense, although they are similar, nowadays Actions seems to be a better choice as it's integrated to the platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants