-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e94d99
commit ac22da0
Showing
6 changed files
with
127 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Publish Package | ||
description: 'Publish the package to Sonatype' | ||
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 | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Publish Library | ||
shell: bash | ||
env: | ||
WORKSPACE_PATH: ${{ inputs.workspace_path }} | ||
LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }} | ||
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry_run }} | ||
SIGNING_KEY_ID: ${{ inputs.signing_key_id }} | ||
SIGNING_KEY_PASSPHRASE: ${{ inputs.signing_key_passphrase }} | ||
SIGNING_SECRET_KEY_RING_FILE: ${{ inputs.code_signing_keyring }} | ||
SONATYPE_USER_NAME: ${{ inputs.sonatype_username }} | ||
SONATYPE_PASSWORD: ${{ inputs.sonatype_password }} | ||
run: source $GITHUB_ACTION_PATH/publish.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -ue | ||
|
||
if $LD_RELEASE_IS_DRYRUN ; then | ||
echo "Doing a dry run of publishing." | ||
else | ||
echo "Publishing to Sonatype" | ||
if [ "${LD_RELEASE_IS_PRERELEASE}" == "true" ]; then | ||
echo "PRERELEASE" | ||
${WORKSPACE_PATH}/gradlew publishToSonatype -p ${WORKSPACE_PATH} -Psigning.keyId="${SIGNING_KEY_ID}" -Psigning.password="${SIGNING_KEY_PASSPHRASE}" -Psigning.secretKeyRingFile="${SIGNING_SECRET_KEY_RING_FILE}" -PsonatypeUsername="${SONATYPE_USER_NAME}" -PsonatypePassword="${SONATYPE_PASSWORD}" || { | ||
echo "Gradle publish/release failed" >&2 | ||
exit 1 | ||
} | ||
else | ||
echo "RELEASE" | ||
${WORKSPACE_PATH}/gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -p ${WORKSPACE_PATH} -Psigning.keyId="${SIGNING_KEY_ID}" -Psigning.password="${SIGNING_KEY_PASSPHRASE}" -Psigning.secretKeyRingFile="${SIGNING_SECRET_KEY_RING_FILE}" -PsonatypeUsername="${SONATYPE_USER_NAME}" -PsonatypePassword="${SONATYPE_PASSWORD}" || { | ||
echo "Gradle publish/release failed" >&2 | ||
exit 1 | ||
} | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Publish Package | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
workspace_path: | ||
description: 'The workspace to publish' | ||
required: true | ||
type: choice | ||
options: | ||
- lib/libotel | ||
prerelease: | ||
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.' | ||
type: boolean | ||
required: true | ||
dry_run: | ||
description: 'Is this a dry run. If so no package will be published.' | ||
type: boolean | ||
required: true | ||
run_tests: | ||
description: 'If true, run unit tests, otherwise skip them.' | ||
type: boolean | ||
default: true | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Shared CI Steps | ||
uses: ./.github/actions/ci | ||
with: | ||
package_path: '${{ inputs.package_path }} | ||
java_version: 8 | ||
- 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/java/keyId = SIGNING_KEY_ID' | ||
s3_path_pairs: 'launchdarkly-releaser/java/code-signing-keyring.gpg = code-signing-keyring.gpg' | ||
|
||
- name: Publish | ||
uses: ./.github/actions/publish | ||
with: | ||
workspace_path: ${{ inputs.workspace_path }} | ||
dry_run: ${{ inputs.dry_run }} | ||
prerelease: ${{ inputs.prerelease }} | ||
code_signing_keyring: 'code-signing-keyring.gpg' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/* | ||
.vscode |