Skip to content

Commit

Permalink
Merge branch 'main' into list_type_check
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrassian-split authored Sep 13, 2022
2 parents c04c87b + 00af2f8 commit d13a310
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 69 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Lint PR'

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ jobs:
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

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

- name: Deploy
run: |
Expand Down
91 changes: 46 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle

# maven deploy commands via via https://tech.clevertap.com/automate-releases-to-maven-central-via-github-actions/

name: Release
# This workflow creates a running release please PR, which tracks all changes
# based on semantic PR titles. When that PR is merged, a publish occurs after
# release please increments the version.

on:
release:
types: [created]

push:
branches:
- main
name: Run Release Please
jobs:
build:

release-please:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

# Release-please creates a PR that tracks all changes
steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
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
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}

- name: Remove SNAPSHOT
run: mvn versions:set -DremoveSnapshot

- name: Deploy
run: |
mvn --batch-mode \
--settings release/m2-settings.xml clean deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main

# 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 }}
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{".":"0.2.0"}
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

## [0.2.0](https://github.com/open-feature/java-sdk/compare/dev.openfeature.javasdk-v0.1.1...dev.openfeature.javasdk-v0.2.0) (2022-09-13)


### ⚠ BREAKING CHANGES

* use value for object resolver
* use instant not zoneddatetime

### Features

* add object to value wrapper ([0152a1e](https://github.com/open-feature/java-sdk/commit/0152a1eef93ea1b5253ddae78718a9805c98aaf7))
* use instant not zoneddatetime ([3e62414](https://github.com/open-feature/java-sdk/commit/3e6241422266825f267043e4acd116803c4939b0))
* use value for object resolver ([5d26247](https://github.com/open-feature/java-sdk/commit/5d262470e8ec47d2af35f0aabe55e8c969e992ac))
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ We hold regular meetings which you can see [here](https://github.com/open-featur

We are also present on the `#openfeature` channel in the [CNCF slack](https://slack.cncf.io/).

## Releasing

See [releasing](./docs/release.md).

## Contributors

Thanks so much to our contributors.
Expand Down
29 changes: 6 additions & 23 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
This is a simple checklist when performing a release.
# Releases

1. Ensure we're up-to-date with the current spec via `./spec_finder.py --diff-output --refresh-spec`
2. Update `README.md` with the current spec that we're up to
3. Update `README.md` to keep the install instructions on the right version
4. Update `<version>` in pom.xml
5. Run `mvn verify` to ensure it all works.
6. Commit the results as the new version.
This repo uses _Release Please_ to release packages. Release Please sets up a running PR that tracks all changes in the library, and maintains the versions according to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), generated when [PRs are merged](https://github.com/amannn/action-semantic-pull-request), based on the PR title. The semantics of the PR title are enforced by the `lint-pr.yml` workflow. When Release Please's running PR is merged, a new release is created, and the associated artifacts are published.

Then in GitHub, trigger a release.
## Customization of changelog and release notes.

1. Go to [github releases](https://github.com/open-feature/java-sdk/releases/new)
2. Name a tag w/ the version you want to release (e.g. `0.1.0`)
3. Click the generate release notes button and write some text about what actually changed.
4. Submit
5. Validate the action which builds the result happened correctly.
If you'd like to add custom content to a release, you can do this by editing the content in a Release Please PR's description. This content will be added to the notes for that release. If you'd like to add content to the changelog, simply push updates to the changelog in the Release Please PR.

If something went wrong above, here's how you reset.
1. Save the release notes you wrote.
2. Delete the release.
3. Delete the tag with `git push --delete origin 0.1.0` where 0.1.0 is your tag name.
## Configuration

```shell
gh release delete 0.1.0 -y
git push --delete origin 0.1.0

gh release create 0.1.0 -F /tmp/010-release.md -t 0.1.0
```
The `release-please-config.json` defines the release please configuration. See schema [here](https://github.com/googleapis/release-please/blob/main/schemas/config.json) to understand all the options. We use the "simple" release strategy and annotate the POM with an element to help release please find the correct XML entity to update (the version element). Release Please stores it's understanding of the current version in the `version.txt` file.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>dev.openfeature</groupId>
<artifactId>javasdk</artifactId>
<version>0.1.1-SNAPSHOT</version>
<version>0.2.0</version> <!--x-release-please-version -->

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
15 changes: 15 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bootstrap-sha": "c701a6c4ebbe1170a25ca7636a31508b9628831c",
"packages": {
".": {
"package-name": "dev.openfeature.javasdk",
"release-type": "simple",
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": true,
"versioning": "default",
"extra-files": [
"pom.xml"
]
}
}
}
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0

0 comments on commit d13a310

Please sign in to comment.