diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml index 390b494..664a8fa 100644 --- a/.github/actions/ci/action.yml +++ b/.github/actions/ci/action.yml @@ -17,8 +17,6 @@ inputs: description: 'The Java distribution to use.' required: false default: 'temurin' - echo_test: - required: false runs: using: composite @@ -29,10 +27,6 @@ runs: distribution: ${{ inputs.java_distribution }} java-version: ${{ inputs.java_version }} - -name: Echo Test - shell: bash - run: echo ${{ inputs.echo_test }} - - name: Restore dependencies shell: bash id: restore @@ -47,3 +41,7 @@ runs: if: steps.build.outcome == 'success' && inputs.run_tests == 'true' shell: bash run: ${{ inputs.workspace_path }}/gradlew test -p ${{ inputs.workspace_path }} + + - name: Build Documentation + shell: bash + run: ${{ inputs.workspace_path }}/gradlew javadoc -p ${{ inputs.workspace_path }} diff --git a/.github/actions/full-release/action.yml b/.github/actions/full-release/action.yml new file mode 100644 index 0000000..609601f --- /dev/null +++ b/.github/actions/full-release/action.yml @@ -0,0 +1,61 @@ +name: Build, Test, and Publish +description: 'Execute the full release process for a workspace.' +inputs: + workspace_path: + description: 'Path to the workspace.' + required: true + dry_run: + description: 'Is this a dry run. If so no package will be published.' + required: true + prerelease: + description: 'Is this a prerelease. If so then it will be published to the staging repository only.' + required: true + signing_key_id: + description: 'Signing key ID' + required: true + signing_key_passphrase: + description: 'Signing key passphrase' + required: true + code_signing_keyring: + description: 'The path of the code signing keyring.' + required: true + sonatype_username: + description: 'Sonatype repo username.' + required: true + sonatype_password: + description: 'Sonatype repo password.' + required: true + aws_role: + description: 'The AWS role to assume, needed to fetch release secrets.' + required: true + token: + description: 'The GitHub token to use for publishing documentation.' + required: true + +runs: + using: composite + steps: + - name: CI Check + uses: ./.github/actions/ci + with: + workspace_path: ${{ inputs.workspace_path }} + java_version: 8 + + - name: Publish + uses: ./.github/actions/publish + with: + workspace_path: ${{ inputs.workspace_path }} + dry_run: ${{ inputs.dry_run }} + prerelease: ${{ inputs.prerelease }} + signing_key_id: ${{ env.SIGNING_KEY_ID }} + signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }} + code_signing_keyring: 'code-signing-keyring.gpg' + sonatype_username: ${{ env.SONATYPE_USER_NAME }} + sonatype_password: ${{ env.SONATYPE_PASSWORD }} + + - name: Publish Documentation + uses: ./.github/actions/publish-docs + with: + workspace_path: ${{ inputs.workspace_path }} + token: ${{ inputs.token }} + dry_run: ${{ inputs.dry_run }} diff --git a/.github/actions/publish-docs/action.yml b/.github/actions/publish-docs/action.yml new file mode 100644 index 0000000..c300ee4 --- /dev/null +++ b/.github/actions/publish-docs/action.yml @@ -0,0 +1,28 @@ +name: Publish Documentation +description: 'Publish the documentation to Github pages' +inputs: + workspace_path: + description: 'Path to the workspace.' + required: true + token: + description: 'Token to use for publishing.' + required: true + dry_run: + description: 'Is this a dry run. If so no docs will be published.' + required: true + +runs: + using: composite + steps: + - uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.1 + name: 'Publish to Github pages' + if: ${{ inputs.dry_run == 'false' }} + with: + docs_path: ${{ inputs.workspace_path }}/build/docs/javadoc + output_path: ${{ inputs.workspace_path }} + github_token: ${{ inputs.token }} + + - name: Dry Run Publish Docs + shell: bash + if: ${{ inputs.dry_run == 'true' }} + run: echo "Dry run. Not publishing docs." diff --git a/.github/workflows/java-server-sdk-otel.yml b/.github/workflows/java-server-sdk-otel.yml index a8866a5..48d2a5a 100644 --- a/.github/workflows/java-server-sdk-otel.yml +++ b/.github/workflows/java-server-sdk-otel.yml @@ -16,19 +16,8 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.1.0 - name: Get secrets - with: - aws_assume_role: ${{ vars.AWS_ROLE_ARN }} - ssm_parameter_pairs: '/production/common/releasing/sonatype/username = SONATYPE_USER_NAME, - /production/common/releasing/sonatype/password = SONATYPE_PASSWORD, - /production/common/releasing/android_code_signing/private_key_id = SIGNING_KEY_ID, - /production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE' - s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg' - - name: Shared CI Steps uses: ./.github/actions/ci with: workspace_path: 'lib/java-server-sdk-otel' java_version: 8 - echo_test: ${{ env.SIGNING_KEY_ID }} diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index b9acd5b..6296bf8 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -29,12 +29,6 @@ jobs: contents: read steps: - uses: actions/checkout@v3 - - - name: Shared CI Steps - uses: ./.github/actions/ci - with: - workspace_path: ${{ inputs.workspace_path }} - java_version: 8 - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.1.0 name: Get secrets @@ -46,10 +40,15 @@ jobs: /production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE' s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg' - - name: Publish - uses: ./.github/actions/publish + - uses: ./.github/actions/full-release with: workspace_path: ${{ inputs.workspace_path }} dry_run: ${{ inputs.dry_run }} prerelease: ${{ inputs.prerelease }} + signing_key_id: ${{ env.SIGNING_KEY_ID }} + signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }} code_signing_keyring: 'code-signing-keyring.gpg' + sonatype_username: ${{ env.SONATYPE_USER_NAME }} + sonatype_password: ${{ env.SONATYPE_PASSWORD }} + aws_role: ${{ vars.AWS_ROLE_ARN }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..12e86a8 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,54 @@ +name: Release Please +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + release-please: + runs-on: ubuntu-latest + + outputs: + package-server-sdk-otel-released: ${{ steps.release.outputs['lib/java-server-sdk-otel--release_created'] }} + + steps: + - uses: google-github-actions/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + target-branch: ${{ github.ref_name }} + + release-server-sdk-otel: + runs-on: ubuntu-latest + needs: release-please + permissions: + id-token: write + contents: write + pull-requests: write + if: ${{ needs.release-please.outputs.package-server-sdk-otel-released == 'true'}} + steps: + - uses: actions/checkout@v4 + + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.1.0 + name: Get secrets + with: + aws_assume_role: ${{ vars.AWS_ROLE_ARN }} + ssm_parameter_pairs: '/production/common/releasing/sonatype/username = SONATYPE_USER_NAME, + /production/common/releasing/sonatype/password = SONATYPE_PASSWORD, + /production/common/releasing/android_code_signing/private_key_id = SIGNING_KEY_ID, + /production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE' + s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg' + + - uses: ./.github/actions/full-release + with: + workspace_path: lib/java-server-sdk-otel + dry_run: true #TODO make this false + prerelease: true #TODO make this false + code_signing_keyring: 'code-signing-keyring.gpg' + signing_key_id: ${{ env.SIGNING_KEY_ID }} + signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }} + sonatype_username: ${{ env.SONATYPE_USER_NAME }} + sonatype_password: ${{ env.SONATYPE_PASSWORD }} + aws_role: ${{ vars.AWS_ROLE_ARN }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..0297c90 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + "lib/java-server-sdk-otel": "0.1.0" +} diff --git a/README.md b/README.md index de2eeee..1acc23a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs. | Telemetry Packages | maven | issues | tests | | ------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- | -| [@launchdarkly/java-server-sdk-otel](lib/java-server-sdk-otel/README.md) | TKTK | [Java OTel][java-otel-issues] | TKTK | +| [@launchdarkly/java-server-sdk-otel](lib/java-server-sdk-otel/README.md) | [![maven][server-otel-maven-badge]][server-otel-maven-link] | [Issues][java-otel-issues] | [![Actions Status][server-otel-ci-badge]][server-otel-ci-link] | ## Organization @@ -43,4 +43,8 @@ We encourage pull requests and other contributions from the community. Check out - [blog.launchdarkly.com](https://blog.launchdarkly.com/ 'LaunchDarkly Blog Documentation') for the latest product updates [//]: # 'java-server-sdk-otel' -[java-otel-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-otel%22+ \ No newline at end of file +[java-otel-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-otel%22+ +[server-otel-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-server-sdk-otel +[server-otel-maven-link]: https://central.sonatype.com/artifact/com.launchdarkly/launchdarkly-java-server-sdk-otel +[server-otel-ci-badge]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-otel.yml/badge.svg +[server-otel-ci-link]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-otel.yml \ No newline at end of file diff --git a/lib/java-server-sdk-otel/gradle.properties b/lib/java-server-sdk-otel/gradle.properties index 2068675..79f6885 100644 --- a/lib/java-server-sdk-otel/gradle.properties +++ b/lib/java-server-sdk-otel/gradle.properties @@ -1,4 +1,7 @@ +#x-release-please-start-version version=0.1.0 +#x-release-please-end + # The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework # and should not be needed for typical development purposes (including by third-party developers). ossrhUsername= diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..c67f594 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,15 @@ +{ + "bootstrap-sha": "4b8717e9622cd7789ded706470b7109e04ce6825", + "separate-pull-requests": true, + "include-component-in-tag": true, + "packages": { + "lib/java-server-sdk-otel": { + "release-type": "simple", + "bump-minor-pre-major": true, + "include-v-in-tag": false, + "extra-files": [ + "gradle.properties" + ] + } + } +}