Skip to content

Commit

Permalink
chore: updating CICD to support java server sdk package (#19)
Browse files Browse the repository at this point in the history
This PR copies existing java-server-sdk code from the public repo and
takes the same approach as other migrated packages.

I made a separate commit for the code copy to make that easier to
verify. All code in lib/sdk/server should be identical to the [existing
repo ](https://github.com/launchdarkly/java-server-sdk)with no changes
intended except for release-please annotations put on
[Version.java](https://github.com/launchdarkly/java-core/pull/19/files#diff-880b7c7410f8d25590e54584048633f4068b855561e85ca77ea767b7514bb82f).
Please check them carefully.
  • Loading branch information
tanderson-ld authored May 21, 2024
1 parent 82d3710 commit 2eb7364
Show file tree
Hide file tree
Showing 303 changed files with 42,269 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/package-server-sdk--bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: 'Bug report for the java-server-sdk package'
about: Create a report to help us improve
title: ''
labels: 'package: java-server-sdk, bug'
assignees: ''
---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing [email protected].

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**SDK version**
The version of this SDK that you are using.

**Language version, developer tools**
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/package-server-sdk--feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request for the java-server-sdk package
about: Suggest an idea for this project
title: ''
labels: 'package: java-server-sdk, enhancement'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
17 changes: 17 additions & 0 deletions .github/actions/contract-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Contract Tests
description: Runs Contract Tests
inputs:
workspace_path:
description: 'Path to the package.'
required: true
token:
description: 'Github token, used for contract tests'
required: false
default: ''

runs:
using: composite
steps:
- name: Run contract tests
shell: bash
run: make contract-tests -C ${{ inputs.workspace_path }}
70 changes: 70 additions & 0 deletions .github/workflows/java-server-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: java-server-sdk

on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' #Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
test-platforms-and-versions:
strategy:
matrix:
os: [windows-2019, ubuntu-20.04]
javaversion: [8, 11, 17, 19]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/sdk/server'
java_version: ${{ matrix.javaversion }}

- name: Contract Tests
- uses: ./.github/actions/contract-tests
with:
service_project_file: pkgs/sdk/server/contract-tests/TestService.csproj
service_dll_file: pkgs/sdk/server/contract-tests/bin/debug/net6.0/ContractTestService.dll
token: ${{ secrets.GITHUB_TOKEN }}

test-contract-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/sdk/server'
java_version: 8

- name: Contract Tests
uses: ./.github/actions/contract-tests
with:
workspace_path: 'lib/sdk/server'
token: ${{ secrets.GITHUB_TOKEN }}

test-packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Shared CI Steps
uses: ./.github/actions/ci
with:
workspace_path: 'lib/sdk/server'
java_version: 8

- name: Publish Maven Local
shell: bash
run: lib/sdk/server/gradlew publishToMavenLocal -p lib/sdk/server -P LD_SKIP_SIGNING=1

- name: Run Packaging Test
shell: bash
run: make all -C lib/sdk/server/packaging-test
1 change: 1 addition & 0 deletions .github/workflows/manual-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- lib/java-server-sdk-otel
- lib/shared/common
- lib/shared/internal
- lib/sdk/server
dry_run:
description: 'Is this a dry run. If so no docs will be published.'
type: boolean
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/manual-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- lib/java-server-sdk-otel
- lib/shared/common
- lib/shared/internal
- lib/sdk/server
prerelease:
description: 'Is this a prerelease.'
type: boolean
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,38 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: ${{ github.ref_name }}

release-server-sdk:
runs-on: ubuntu-latest
needs: release-please
permissions:
id-token: write
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.package-server-sdk-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'
s3_path_pairs: 'launchdarkly-releaser/java/code-signing-keyring.gpg = code-signing-keyring.gpg'

- uses: ./.github/actions/full-release
with:
workspace_path: lib/sdk/server
dry_run: false
prerelease: 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 }}

release-server-sdk-otel:
runs-on: ubuntu-latest
needs: release-please
Expand Down
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lib/java-server-sdk-otel": "0.1.0",
"lib/shared/common": "2.1.1",
"lib/shared/internal": "1.3.0"
"lib/shared/internal": "1.3.0",
"lib/sdk/server": "7.4.1"
}
13 changes: 13 additions & 0 deletions .sdk_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"sdks": {
"java-server-sdk": {
"name": "Java Server SDK",
"type": "server-side",
"path": "lib/sdk/server",
"languages": [
"Java"
]
}
}
}
21 changes: 21 additions & 0 deletions lib/sdk/server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Eclipse project files
.classpath
.project
.settings

# Intellij project files
*.iml
*.ipr
*.iws
.idea/

#Gradle
.gradletasknamecache
.gradle/
build/
bin/
out/
classes/

packaging-test/temp/
benchmarks/lib/
Loading

0 comments on commit 2eb7364

Please sign in to comment.