|
| 1 | +name: 'Publish Android SDK' |
| 2 | +description: 'Build and publish Android SDK packages to Maven Central' |
| 3 | + |
| 4 | +inputs: |
| 5 | + workspace-path: |
| 6 | + description: 'Path to the Android SDK workspace' |
| 7 | + required: true |
| 8 | + default: 'sdk/@launchdarkly/observability-android' |
| 9 | + java_version: |
| 10 | + description: 'The Java version to use.' |
| 11 | + required: false |
| 12 | + default: '17' |
| 13 | + java_distribution: |
| 14 | + description: 'The Java distribution to use.' |
| 15 | + required: false |
| 16 | + default: 'temurin' |
| 17 | + aws-role-arn: |
| 18 | + description: 'AWS role ARN for accessing secrets' |
| 19 | + required: true |
| 20 | + dry-run: |
| 21 | + description: 'Whether to run the publish in dry-run mode' |
| 22 | + required: false |
| 23 | + default: 'false' |
| 24 | + prerelease: |
| 25 | + description: 'Whether to publish a prerelease version' |
| 26 | + required: false |
| 27 | + default: 'false' |
| 28 | + |
| 29 | +runs: |
| 30 | + using: 'composite' |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Setup Java |
| 36 | + uses: actions/setup-java@v4 |
| 37 | + with: |
| 38 | + distribution: ${{ inputs.java_distribution }} |
| 39 | + java-version: ${{ inputs.java_version }} |
| 40 | + |
| 41 | + - name: Setup Android SDK |
| 42 | + uses: android-actions/setup-android@v3 |
| 43 | + |
| 44 | + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0 |
| 45 | + name: Get secrets |
| 46 | + with: |
| 47 | + aws_assume_role: ${{ inputs.aws-role-arn }} |
| 48 | + ssm_parameter_pairs: | |
| 49 | + /production/common/releasing/sonatype/central/username = SONATYPE_USER_NAME, |
| 50 | + /production/common/releasing/sonatype/central/password = SONATYPE_PASSWORD, |
| 51 | + /production/common/releasing/android_code_signing/private_key_id = SIGNING_KEY_ID, |
| 52 | + /production/common/releasing/android_code_signing/private_key_passphrase = SIGNING_KEY_PASSPHRASE |
| 53 | + s3_path_pairs: 'launchdarkly-releaser/android/code-signing-keyring.gpg = code-signing-keyring.gpg' |
| 54 | + |
| 55 | + - name: Publish Library |
| 56 | + shell: bash |
| 57 | + if: ${{ inputs.dry-run != 'true' }} |
| 58 | + working-directory: ${{ inputs.workspace-path }} |
| 59 | + env: |
| 60 | + LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }} |
| 61 | + SIGNING_KEY_ID: ${{ env.SIGNING_KEY_ID }} |
| 62 | + SIGNING_KEY_PASSPHRASE: ${{ env.SIGNING_KEY_PASSPHRASE }} |
| 63 | + SIGNING_SECRET_KEY_RING_FILE: ${{ github.workspace }}/code-signing-keyring.gpg |
| 64 | + SONATYPE_USER_NAME: ${{ env.SONATYPE_USER_NAME }} |
| 65 | + SONATYPE_PASSWORD: ${{ env.SONATYPE_PASSWORD }} |
| 66 | + run: source $GITHUB_ACTION_PATH/publish.sh |
| 67 | + |
| 68 | + - name: Dry Run Publish Library |
| 69 | + shell: bash |
| 70 | + if: ${{ inputs.dry-run == 'true' }} |
| 71 | + run: echo "Dry run. Not publishing." |
0 commit comments