Skip to content
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

ci: fixing variable usage in publish action #8

Closed
wants to merge 10 commits into from
10 changes: 4 additions & 6 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ inputs:
description: 'The Java distribution to use.'
required: false
default: 'temurin'
echo_test:
required: false

runs:
using: composite
Expand All @@ -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
Expand All @@ -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 }}
61 changes: 61 additions & 0 deletions .github/actions/full-release/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}
28 changes: 28 additions & 0 deletions .github/actions/publish-docs/action.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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."
11 changes: 0 additions & 11 deletions .github/workflows/java-server-sdk-otel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: launchdarkly/gh-actions/actions/[email protected]
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 }}
15 changes: 7 additions & 8 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
name: Get secrets
Expand All @@ -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 }}
54 changes: 54 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"lib/java-server-sdk-otel": "0.1.0"
}
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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+
[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
3 changes: 3 additions & 0 deletions lib/java-server-sdk-otel/gradle.properties
Original file line number Diff line number Diff line change
@@ -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=
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": "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"
]
}
}
}
Loading