Migrate workflow secrets to AWS Secrets Manager #100
Workflow file for this run
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Gradle Wrapper Validation | |
| uses: gradle/actions/wrapper-validation@v6 | |
| - name: Install JDK 11 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 11 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Test Plugin | |
| run: ./gradlew -p focus-gradle-plugin clean check --no-daemon --stacktrace | |
| - name: (Fail-only) Bundle test reports | |
| if: failure() | |
| run: find . -type d -name 'reports' | zip -@ -r build-reports.zip | |
| - name: (Fail-only) Upload the build report | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: error-report | |
| path: build-reports.zip | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'dropbox/focus' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' | |
| needs: [build] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Install JDK 11 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version: 11 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Configure AWS credentials (OIDC) | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: arn:aws:iam::521590706193:role/oidc-github-dropbox-focus-branch-main | |
| aws-region: us-west-2 | |
| - name: Get Maven Central secrets from AWS Secrets Manager | |
| uses: aws-actions/aws-secretsmanager-get-secrets@v3 | |
| with: | |
| secret-ids: | | |
| SONATYPE_USERNAME,sdk-release-maven-central-token-username | |
| SONATYPE_PASSWORD,sdk-release-maven-central-token-password | |
| SIGNING_KEY,sdk-release-signing-key | |
| SIGNING_PASSWORD,sdk-release-signing-password | |
| parse-json-secrets: false | |
| - name: Publish release | |
| run: ./gradlew -p focus-gradle-plugin clean publish --no-daemon --no-parallel --no-configuration-cache --stacktrace | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ env.SONATYPE_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ env.SONATYPE_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ env.SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ env.SIGNING_PASSWORD }} |