-
Notifications
You must be signed in to change notification settings - Fork 19
Java release process #378
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
base: trunk
Are you sure you want to change the base?
Java release process #378
Changes from all commits
6777fea
97f2bcb
2e01642
dcfddf2
f30b508
c3ba4b8
61fbffe
79f9be1
04e92ed
6b0b9f9
344303d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_version: | ||
| description: 'The release version (will infer from current -SNAPSHOT)' | ||
| required: false | ||
| default: '' | ||
| next_version: | ||
| description: 'The next dev version (will infer from release version)' | ||
| required: false | ||
| default: '' | ||
|
|
||
| concurrency: | ||
| group: release | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # - name: Import GPG key and upload to keyserver | ||
| # run: | | ||
| # echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --no-tty --import | ||
| # KEY_ID=$(gpg --list-keys --keyid-format LONG | grep pub | awk '{print $2}' | cut -d'/' -f2) | ||
| # echo "Key ID is: $KEY_ID" | ||
| # gpg --batch --no-tty --keyserver keyserver.ubuntu.com --send-keys $KEY_ID | ||
| # gpg --batch --no-tty --keyserver keys.openpgp.org --send-keys $KEY_ID | ||
| # exit 0 | ||
|
|
||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 | ||
| with: | ||
| java-version: '11' | ||
| distribution: 'temurin' | ||
| server-id: central # Value of the distributionManagement/repository/id field of the pom.xml | ||
| server-username: "CENTRAL_USERNAME" # env variable for username in deploy | ||
| server-password: "CENTRAL_TOKEN" # env variable for token in deploy | ||
| gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
| gpg-passphrase: "GPG_PASSPHRASE" # env variable for GPG private key passphrase | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should probably be a secret rather than an ENV variable
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The values are all secrets, but the comment is ambiguous, what is being configured in line 1,2 and 4 is the name of environment variables used in the setup-java. These match the secrets names. If that makes sense?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really. If there's no |
||
|
|
||
| - name: Add virtual env entry to hosts file | ||
| run: echo "127.0.0.1 vip.ve.atsign.zone" | sudo tee -a /etc/hosts | ||
|
|
||
| - name: Configure git | ||
| run: | | ||
| git config user.name 'library-action[bot]' | ||
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
|
|
||
| - name: Read project version | ||
| id: version | ||
| run: | | ||
| VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) | ||
| echo "current=$VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Compute versions | ||
| id: compute | ||
| run: | | ||
| if [ -n "${{ inputs.release_version }}" ]; then | ||
| RELEASE=${{ inputs.release_version }} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely needs to be reworked to use a release tag |
||
| else | ||
| CURRENT="${{ steps.version.outputs.current }}" | ||
| if [[ "$CURRENT" != *-SNAPSHOT ]]; then | ||
| echo "Project is not a SNAPSHOT version" | ||
| exit 1 | ||
| fi | ||
| RELEASE=${CURRENT%-SNAPSHOT} | ||
| fi | ||
| if [ -n "${{ inputs.next_version }}" ]; then | ||
| NEXT="${{ inputs.next_version }}" | ||
| [[ "NEXT" != *-SNAPSHOT ]] && NEXT="${NEXT}-SNAPSHOT" | ||
| else | ||
| BASE=${RELEASE%.*} | ||
| PATCH=${RELEASE##*.} | ||
| NEXT_PATCH=$((PATCH + 1)) | ||
| NEXT="$BASE.$NEXT_PATCH-SNAPSHOT" | ||
| fi | ||
| echo "release=$RELEASE" >> $GITHUB_OUTPUT | ||
| echo "next=$NEXT" >> $GITHUB_OUTPUT | ||
| echo "Release version: $RELEASE" | ||
| echo "Next snapshot: $NEXT" | ||
|
|
||
| - name: Update README | ||
| run: | | ||
| find . -type f -name "README.md" -exec \ | ||
| sed -i -E \ | ||
| -e "s|<version>.+[0-9]</version>|<version>${{ steps.compute.outputs.release }}</version>|" \ | ||
| -e "s|<version>.+-SNAPSHOT</version>|<version>${{ steps.compute.outputs.next }}</version>|" \ | ||
| {} \; | ||
|
|
||
| - name: Set release version | ||
| run: | | ||
| mvn -B versions:set -DnewVersion=${{ steps.compute.outputs.release }} | ||
| mvn -B versions:commit | ||
| git commit -am "build: release ${{ steps.compute.outputs.release }}" | ||
|
|
||
| - name: Tag release | ||
| run: | | ||
| git tag -a v${{ steps.compute.outputs.release }} -m "build: release ${{ steps.compute.outputs.release }}" | ||
|
|
||
| - name: Regenerate CHANGELOG.md | ||
| run: mvn -pl . git-changelog-maven-plugin:git-changelog | ||
|
|
||
| - name: Publish to Central | ||
| run: mvn deploy --batch-mode --no-transfer-progress | ||
| env: | ||
| CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | ||
| CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} | ||
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
|
|
||
| - name: Set next snapshot | ||
| run: | | ||
| mvn -B versions:set -DnewVersion=${{ steps.compute.outputs.next }} | ||
| mvn -B versions:commit | ||
| git commit -am "chore: next release ${{ steps.compute.outputs.next }}" | ||
|
|
||
| - name: Push commits and tags | ||
| run: git push --follow-tags | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,76 +1,21 @@ | ||
| # What's here / changelog | ||
| # Changelog | ||
|
|
||
| ## Next | ||
|
|
||
| * Getting started guide - from nothing to end-to-end-encrypted chat session in | ||
| < 5 minutes | ||
| * fluid client APIs for sharing data - e.g. | ||
| share(value).with(atSign/s).as(keyName) | ||
| * extend client REPL so that you can call AtClient methods (e.g. the | ||
| share() above) interactively | ||
| ## v0.0.2 (2026-03-29) | ||
|
|
||
| ## May 29 2022 | ||
| ### Features | ||
| - release workflow to publish tagged versions | ||
| - add support for populating and using sharedKeyEnc (and associated fields) | ||
| - support for binary key values (#374) | ||
| - updated build to jdk 11 (#355) | ||
| - migrate to multimodule, consolidate dependency management and plugin configuration into parent pom. (#350) | ||
| - adds spotless and checkstyle plugins to maven build lifecycle. reformats and adjusts code to pass checkstyle, spotless and codeql rulesfeat: removed lint from markdown files | ||
| - support for apkam authentication model plus the onboarding and enrollment workflow. added support for ivNonce field in key metadata, enhanced implementation to use random IVs when encrypting/decrypting data, writing/reading iv to/from meta data. added version field to atKeys JSON | ||
|
|
||
| * Retry bug fixed in Register CLI | ||
| * Config yaml parameters restructured and backwards compatibility provided | ||
| so as not to break existing usage. | ||
| * New parameter added to validateOtp method in RegisterUtil.java. The usage | ||
| of this parameter is provided in java docs of the respective method. | ||
| ### Bug Fixes | ||
| - replace boilerplate code and consolidate common classes | ||
| - corrected javadoc. javadoc plugin is now configured to fail on error. checkstyle has been expanded to enforce class comments (#356) | ||
| - removed direct output to stderr and stdout in core library code, CLI and examples still use System.out/err, replaced with slf4j using lombok annotations | ||
| - enhance KeyStringUtil so that it parses namespaces (#326) | ||
|
|
||
| ## May 18 2022 | ||
|
|
||
| * A new CLI tool Register has been introduced which can acquire a free atsign | ||
| and register it to the provided email. | ||
| * Register CLI also handles calling the Onboard client with the cram secret | ||
| which was received during the registration process. | ||
|
|
||
| ## May 03 2022 | ||
|
|
||
| * Better event distribution | ||
| * Improved Monitor's event generation | ||
| * Added 'userDefined' to the AtEventType enum, to allow the event bus to be | ||
| used by application code | ||
| * Caches shared keys after first retrieval | ||
| * AtClientImpl listens for updateNotification events, decrypts the ciphertext | ||
| on-the-fly, and publishes a decryptedUpdateNotification which is more useful | ||
| for application code | ||
| * Enhanced REPL to optionally listen to only decryptedUpdateNotification; | ||
| added command-line flag to listen to both | ||
|
|
||
| ## Apr 29 2022 | ||
|
|
||
| * **at_client** : Initial implementation of Java client library for the | ||
| atPlatform. README will come soon but here's a very brief summary which | ||
| will get you going if you already know the basics of the atPlatform and have | ||
| used the Dart/Flutter packages. | ||
|
|
||
| ### Using Maven | ||
|
|
||
| The Maven target you want is 'install' which will put things in the 'target' | ||
| output directory | ||
|
|
||
| ### CLI tools | ||
|
|
||
| Will give you the best overview of how to use the library as a whole. There | ||
| are five CLIs in the initial commit: | ||
|
|
||
| * **Activate** - generate keys for a new @-sign. If you already have a .keys | ||
| file, you can reuse it. Currently, the Java library expects keys for @alice | ||
| to be in ./keys/@alice.keys. | ||
| * **REPL** - you can use this to type @-protocol commands and see responses; | ||
| but the best thing about the REPL currently is that it shows the data | ||
| notifications as they are received. The REPL code has th eessentials of what | ||
| a 'receiving' client needs to do - i.e. | ||
| * create an AtClient | ||
| * add an event listener which | ||
| * receives data update/delete notification events (the event data contains | ||
| the ciphertext) | ||
| * calls 'get' to decrypt | ||
| * **Share** - a simple 'sender' client - shares some data with another @-sign | ||
| * **Get** - gets data which was shared by another @-sign | ||
| * **Delete** - deletes data that this Atsign previously shared with another | ||
|
|
||
| **Note:** | ||
| As of May 3 2022, the Java client library can still be considered a 1.0.0-Beta | ||
| version - i.e. there may occasionally be breaking changes, based on feedback | ||
| from users of the library, until we get to a final version 1.0.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Changelog | ||
|
|
||
| {{#tags}} | ||
| {{#ifEquals name "Unreleased"}} | ||
| ## Unreleased | ||
|
|
||
| {{#ifContainsType commits type='feat'}} | ||
| ### Features | ||
| {{#commits}} | ||
| {{#ifCommitType . type='feat'}} | ||
| - {{#eachCommitScope .}}**{{.}}**: {{/eachCommitScope}}{{{commitDescription .}}} | ||
| {{/ifCommitType}} | ||
| {{/commits}} | ||
| {{/ifContainsType}} | ||
|
|
||
| {{#ifContainsType commits type='fix'}} | ||
| ### Bug Fixes | ||
| {{#commits}} | ||
| {{#ifCommitType . type='fix'}} | ||
| - {{#eachCommitScope .}}**{{.}}**: {{/eachCommitScope}}{{{commitDescription .}}} | ||
| {{/ifCommitType}} | ||
| {{/commits}} | ||
| {{/ifContainsType}} | ||
|
|
||
| {{/ifEquals}} | ||
|
|
||
| {{#ifReleaseTag .}} | ||
| ## {{name}} ({{tagDate .}}) | ||
|
|
||
| {{#ifContainsType commits type='feat'}} | ||
| ### Features | ||
| {{#commits}} | ||
| {{#ifCommitType . type='feat'}} | ||
| - {{#eachCommitScope .}}**{{.}}**: {{/eachCommitScope}}{{{commitDescription .}}} | ||
| {{/ifCommitType}} | ||
| {{/commits}} | ||
| {{/ifContainsType}} | ||
|
|
||
| {{#ifContainsType commits type='fix'}} | ||
| ### Bug Fixes | ||
| {{#commits}} | ||
| {{#ifCommitType . type='fix'}} | ||
| - {{#eachCommitScope .}}**{{.}}**: {{/eachCommitScope}}{{{commitDescription .}}} | ||
| {{/ifCommitType}} | ||
| {{/commits}} | ||
| {{/ifContainsType}} | ||
|
|
||
| {{#ifContainsBreaking commits}} | ||
| ### Breaking Changes | ||
| {{#commits}} | ||
| {{#ifCommitBreaking .}} | ||
| - {{#eachCommitScope .}}**{{.}}**: {{/eachCommitScope}}{{{commitDescription .}}} | ||
| {{/ifCommitBreaking}} | ||
| {{/commits}} | ||
| {{/ifContainsBreaking}} | ||
|
|
||
| {{/ifReleaseTag}} | ||
| {{/tags}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we trigger a release with a tag that's generated by creating a GitHub release.
We often also have a workflow_dispatch trigger for manual testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did start off with that approach but ran into problems in that the version tag should be on the commit that updated the pom versions, README edit and CHANGELOG. I guess we could have 2 lots of tags, those that trigger the release workflow and then a corresponding version tag that gets added as part of the workflow. Shall I go with that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at https://github.com/atsign-foundation/noports/blob/trunk/.github/workflows/multibuild.yaml for how we handle similar needs for NoPorts