Skip to content

Commit 223648b

Browse files
authored
ci: adding release please support (#4)
Adds release please support
1 parent 69df5c7 commit 223648b

File tree

10 files changed

+181
-27
lines changed

10 files changed

+181
-27
lines changed

.github/actions/ci/action.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ inputs:
1717
description: 'The Java distribution to use.'
1818
required: false
1919
default: 'temurin'
20-
echo_test:
21-
required: false
2220

2321
runs:
2422
using: composite
@@ -29,10 +27,6 @@ runs:
2927
distribution: ${{ inputs.java_distribution }}
3028
java-version: ${{ inputs.java_version }}
3129

32-
-name: Echo Test
33-
shell: bash
34-
run: echo ${{ inputs.echo_test }}
35-
3630
- name: Restore dependencies
3731
shell: bash
3832
id: restore
@@ -47,3 +41,7 @@ runs:
4741
if: steps.build.outcome == 'success' && inputs.run_tests == 'true'
4842
shell: bash
4943
run: ${{ inputs.workspace_path }}/gradlew test -p ${{ inputs.workspace_path }}
44+
45+
- name: Build Documentation
46+
shell: bash
47+
run: ${{ inputs.workspace_path }}/gradlew javadoc -p ${{ inputs.workspace_path }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build, Test, and Publish
2+
description: 'Execute the full release process for a workspace.'
3+
inputs:
4+
workspace_path:
5+
description: 'Path to the workspace.'
6+
required: true
7+
dry_run:
8+
description: 'Is this a dry run. If so no package will be published.'
9+
required: true
10+
prerelease:
11+
description: 'Is this a prerelease. If so then it will be published to the staging repository only.'
12+
required: true
13+
signing_key_id:
14+
description: 'Signing key ID'
15+
required: true
16+
signing_key_passphrase:
17+
description: 'Signing key passphrase'
18+
required: true
19+
code_signing_keyring:
20+
description: 'The path of the code signing keyring.'
21+
required: true
22+
sonatype_username:
23+
description: 'Sonatype repo username.'
24+
required: true
25+
sonatype_password:
26+
description: 'Sonatype repo password.'
27+
required: true
28+
aws_role:
29+
description: 'The AWS role to assume, needed to fetch release secrets.'
30+
required: true
31+
token:
32+
description: 'The GitHub token to use for publishing documentation.'
33+
required: true
34+
35+
runs:
36+
using: composite
37+
steps:
38+
- name: CI Check
39+
uses: ./.github/actions/ci
40+
with:
41+
workspace_path: ${{ inputs.workspace_path }}
42+
java_version: 8
43+
44+
- name: Publish
45+
uses: ./.github/actions/publish
46+
with:
47+
workspace_path: ${{ inputs.workspace_path }}
48+
dry_run: ${{ inputs.dry_run }}
49+
prerelease: ${{ inputs.prerelease }}
50+
signing_key_id: ${{ env.SIGNING_KEY_ID }}
51+
signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }}
52+
code_signing_keyring: 'code-signing-keyring.gpg'
53+
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
54+
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
55+
56+
- name: Publish Documentation
57+
uses: ./.github/actions/publish-docs
58+
with:
59+
workspace_path: ${{ inputs.workspace_path }}
60+
token: ${{ inputs.token }}
61+
dry_run: ${{ inputs.dry_run }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Documentation
2+
description: 'Publish the documentation to Github pages'
3+
inputs:
4+
workspace_path:
5+
description: 'Path to the workspace.'
6+
required: true
7+
token:
8+
description: 'Token to use for publishing.'
9+
required: true
10+
dry_run:
11+
description: 'Is this a dry run. If so no docs will be published.'
12+
required: true
13+
14+
runs:
15+
using: composite
16+
steps:
17+
- uses: launchdarkly/gh-actions/actions/[email protected]
18+
name: 'Publish to Github pages'
19+
if: ${{ inputs.dry_run == 'false' }}
20+
with:
21+
docs_path: ${{ workspace_path }}/build/docs/javadoc
22+
output_path: ${{ workspace_path }}
23+
github_token: ${{ inputs.token }}
24+
25+
- name: Dry Run Publish Docs
26+
shell: bash
27+
if: ${{ inputs.dry_run == 'true' }}
28+
run: echo "Dry run. Not publishing docs."

.github/workflows/java-server-sdk-otel.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,8 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v3
1818

19-
- uses: launchdarkly/gh-actions/actions/[email protected]
20-
name: Get secrets
21-
with:
22-
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
23-
ssm_parameter_pairs: '/production/common/releasing/sonatype/username = SONATYPE_USER_NAME,
24-
/production/common/releasing/sonatype/password = SONATYPE_PASSWORD,
25-
/production/common/releasing/android_code_signing/private_key_id = SIGNING_KEY_ID,
26-
/production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE'
27-
s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg'
28-
2919
- name: Shared CI Steps
3020
uses: ./.github/actions/ci
3121
with:
3222
workspace_path: 'lib/java-server-sdk-otel'
3323
java_version: 8
34-
echo_test: ${{ env.SIGNING_KEY_ID }}

.github/workflows/manual-publish.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ jobs:
2929
contents: read
3030
steps:
3131
- uses: actions/checkout@v3
32-
33-
- name: Shared CI Steps
34-
uses: ./.github/actions/ci
35-
with:
36-
workspace_path: ${{ inputs.workspace_path }}
37-
java_version: 8
3832

3933
- uses: launchdarkly/gh-actions/actions/[email protected]
4034
name: Get secrets
@@ -46,10 +40,15 @@ jobs:
4640
/production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE'
4741
s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg'
4842

49-
- name: Publish
50-
uses: ./.github/actions/publish
43+
- uses: ./.github/actions/full-release
5144
with:
5245
workspace_path: ${{ inputs.workspace_path }}
5346
dry_run: ${{ inputs.dry_run }}
5447
prerelease: ${{ inputs.prerelease }}
48+
signing_key_id: ${{ env.SIGNING_KEY_ID }}
49+
signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }}
5550
code_signing_keyring: 'code-signing-keyring.gpg'
51+
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
52+
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
53+
aws_role: ${{ vars.AWS_ROLE_ARN }}
54+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release-please.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release Please
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-please:
10+
runs-on: ubuntu-latest
11+
12+
outputs:
13+
package-server-sdk-otel-released: ${{ steps.release.outputs['lib/java-server-sdk-otel--release_created'] }}
14+
15+
steps:
16+
- uses: google-github-actions/release-please-action@v4
17+
id: release
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
target-branch: ${{ github.ref_name }}
21+
22+
release-server-sdk-otel:
23+
runs-on: ubuntu-latest
24+
needs: release-please
25+
permissions:
26+
id-token: write
27+
contents: write
28+
pull-requests: write
29+
if: ${{ needs.release-please.outputs.package-server-sdk-otel-released == 'true'}}
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: launchdarkly/gh-actions/actions/[email protected]
34+
name: Get secrets
35+
with:
36+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
37+
ssm_parameter_pairs: '/production/common/releasing/sonatype/username = SONATYPE_USER_NAME,
38+
/production/common/releasing/sonatype/password = SONATYPE_PASSWORD,
39+
/production/common/releasing/android_code_signing/private_key_id = SIGNING_KEY_ID,
40+
/production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE'
41+
s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg'
42+
43+
- uses: ./.github/actions/full-release
44+
with:
45+
workspace_path: lib/java-server-sdk-otel
46+
dry_run: true #TODO make this false
47+
prerelease: true #TODO make this false
48+
code_signing_keyring: 'code-signing-keyring.gpg'
49+
signing_key_id: ${{ env.SIGNING_KEY_ID }}
50+
signing_key_passphrase: ${{ env.SIGNING_KEY_PASSPHRASE }}
51+
sonatype_username: ${{ env.SONATYPE_USER_NAME }}
52+
sonatype_password: ${{ env.SONATYPE_PASSWORD }}
53+
aws_role: ${{ vars.AWS_ROLE_ARN }}
54+
token: ${{ secrets.GITHUB_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"lib/java-server-sdk-otel": "0.1.0"
3+
}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
77

88
| Telemetry Packages | maven | issues | tests |
99
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- |
10-
| [@launchdarkly/java-server-sdk-otel](lib/java-server-sdk-otel/README.md) | TKTK | [Java OTel][java-otel-issues] | TKTK |
10+
| [@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] |
1111

1212
## Organization
1313

@@ -43,4 +43,8 @@ We encourage pull requests and other contributions from the community. Check out
4343
- [blog.launchdarkly.com](https://blog.launchdarkly.com/ 'LaunchDarkly Blog Documentation') for the latest product updates
4444

4545
[//]: # 'java-server-sdk-otel'
46-
[java-otel-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-otel%22+
46+
[java-otel-issues]: https://github.com/launchdarkly/java-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+java-server-sdk-otel%22+
47+
[server-otel-maven-badge]: https://img.shields.io/maven-central/v/com.launchdarkly/launchdarkly-java-server-sdk-otel
48+
[server-otel-maven-link]: https://central.sonatype.com/artifact/com.launchdarkly/launchdarkly-java-server-sdk-otel
49+
[server-otel-ci-badge]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-otel.yml/badge.svg
50+
[server-otel-ci-link]: https://github.com/launchdarkly/java-core/actions/workflows/java-server-sdk-otel.yml

lib/java-server-sdk-otel/gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
#x-release-please-start-version
12
version=0.1.0
3+
#x-release-please-end
4+
25
# The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework
36
# and should not be needed for typical development purposes (including by third-party developers).
47
ossrhUsername=

release-please-config.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"bootstrap-sha": "4b8717e9622cd7789ded706470b7109e04ce6825",
3+
"separate-pull-requests": true,
4+
"include-component-in-tag": true,
5+
"packages": {
6+
"lib/java-server-sdk-otel": {
7+
"release-type": "simple",
8+
"bump-minor-pre-major": true,
9+
"include-v-in-tag": false,
10+
"extra-files": [
11+
"gradle.properties"
12+
]
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)