Skip to content

chore: Add release plz #66

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

Merged
merged 3 commits into from
Sep 13, 2022
Merged

chore: Add release plz #66

merged 3 commits into from
Sep 13, 2022

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Sep 13, 2022

This add's release please, a means of transparently keeping track of pending code to release, and auto-incrementing versions.

The lint-pr.yml workflow enforces semantically-titled PRs, which become the commit message after any merge. The release please action then maintains an open PR of changes (see example here in node-contribs). When this is merged, release plz runs the same publish functionality as before. It also generates release notes automatically and creates a github release.

Signed-off-by: Todd Baert <toddbaert@gmail.com>
@toddbaert toddbaert changed the title Add release plz chore: Add release plz Sep 13, 2022
Comment on lines +59 to +62

# Add -SNAPSHOT before deploy
- name: Add SNAPSHOT
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer maintain -SNAPSHOT in the POM because Release Please will delete -SNAPSHOT every time it increments. So now instead we just add -SNAPSHOT in non-release builds dynamically.

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2022

Codecov Report

Merging #66 (502f9e5) into main (89ea363) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main      #66   +/-   ##
=========================================
  Coverage     91.27%   91.27%           
  Complexity      159      159           
=========================================
  Files            19       19           
  Lines           344      344           
  Branches         14       14           
=========================================
  Hits            314      314           
  Misses           21       21           
  Partials          9        9           
Flag Coverage Δ
unittests 91.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines +23 to +52
# These steps are only run if this was a merged release-please PR
- name: checkout
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v3
- name: Set up JDK 8
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
server-id: ossrh
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}

- name: Configure GPG Key
if: ${{ steps.release.outputs.releases_created }}
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

- name: Deploy
if: ${{ steps.release.outputs.releases_created }}
run: |
mvn --batch-mode \
--settings release/m2-settings.xml clean deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically the same release process as before, just with all steps conditional on ${{ steps.release.outputs.releases_created }} (meaning this is a merged release plz PR).

@@ -4,7 +4,7 @@

<groupId>dev.openfeature</groupId>
<artifactId>javasdk</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.1.1</version> <!--x-release-please-version -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tells release plz to correctly increment this version.

Comment on lines +7 to +8
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These settings treat the minor version as the breaking indicator when we are at version < 1

Copy link
Member

@justinabrahms justinabrahms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please add info about how releaseplz works to a README somewhere.

Signed-off-by: Todd Baert <toddbaert@gmail.com>
@toddbaert
Copy link
Member Author

toddbaert commented Sep 13, 2022

Looks good. Please add info about how releaseplz works to a README somewhere.

Done. I've updated the release doc you wrote to explain release please and linked to it from the main readme.

Signed-off-by: Todd Baert <toddbaert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants