11# This workflow will build the project, run integration tests, and release.
2- # Because secrets are not available on external forks, this job is expected to fail
3- # on external pull requests.
2+ # Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC.
43
54name : Build, Check, Publish
65
1514jobs :
1615 build :
1716 runs-on : ubuntu-latest
17+ permissions :
18+ id-token : write
19+ contents : read
1820 steps :
1921 - name : Checkout Repo
2022 uses : actions/checkout@v3
2123
24+ - name : Configure AWS credentials for Docker Hub secrets (OIDC)
25+ if : github.event_name != 'pull_request'
26+ uses : aws-actions/configure-aws-credentials@v6
27+ with :
28+ role-to-assume : arn:aws:iam::301904545275:role/oidc-github-hellosign-dropbox-sign-java-branch-main
29+ aws-region : us-west-2
30+
31+ - name : Get Docker Hub secrets from AWS Secrets Manager
32+ if : github.event_name != 'pull_request'
33+ uses : aws-actions/aws-secretsmanager-get-secrets@v3
34+ with :
35+ secret-ids : |
36+ DOCKER_USERNAME,github-actions/hellosign/shared/docker-username
37+ DOCKER_TOKEN,github-actions/hellosign/shared/docker-token
38+ parse-json-secrets : false
39+
2240 - name : Build SDK
2341 run : ./run-build
24- env :
25- DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
26- DOCKER_TOKEN : ${{secrets.DOCKER_TOKEN}}
2742
2843 - name : Ensure no changes in Generated Code
2944 run : ./bin/check-clean-git-status
3752 && github.ref == 'refs/heads/main'
3853 && github.event_name != 'pull_request'
3954 needs : [ build ]
55+ permissions :
56+ id-token : write
57+ contents : read
4058 steps :
4159 - name : Checkout
4260 uses : actions/checkout@v3
@@ -50,23 +68,39 @@ jobs:
5068 - name : Retrieve version
5169 run : echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV
5270
71+ - name : Configure AWS credentials for Maven secrets (OIDC)
72+ uses : aws-actions/configure-aws-credentials@v6
73+ with :
74+ role-to-assume : arn:aws:iam::521590706193:role/oidc-github-hellosign-dropbox-sign-java-branch-main
75+ aws-region : us-west-2
76+
77+ - name : Get Maven Central secrets from AWS Secrets Manager
78+ uses : aws-actions/aws-secretsmanager-get-secrets@v3
79+ with :
80+ secret-ids : |
81+ SONATYPE_USERNAME,sdk-release-maven-central-token-username
82+ SONATYPE_PASSWORD,sdk-release-maven-central-token-password
83+ SIGNING_KEY,sdk-release-signing-key
84+ SIGNING_PASSWORD,sdk-release-signing-password
85+ parse-json-secrets : false
86+
5387 - name : Publish to Maven Central
5488 run : ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
5589 if : " !endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
5690 env :
57- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets .SONATYPE_USERNAME }}
58- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets .SONATYPE_PASSWORD }}
59- ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets .SIGNING_KEY }}
60- ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets .SIGNING_PASSWORD }}
91+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ env .SONATYPE_USERNAME }}
92+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ env .SONATYPE_PASSWORD }}
93+ ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ env .SIGNING_KEY }}
94+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ env .SIGNING_PASSWORD }}
6195
6296 - name : Publish Snapshot
6397 run : ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
6498 if : " endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
6599 env :
66- ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets .SONATYPE_USERNAME }}
67- ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ secrets .SONATYPE_PASSWORD }}
68- ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ secrets .SIGNING_KEY }}
69- ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ secrets .SIGNING_PASSWORD }}
100+ ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ env .SONATYPE_USERNAME }}
101+ ORG_GRADLE_PROJECT_mavenCentralPassword : ${{ env .SONATYPE_PASSWORD }}
102+ ORG_GRADLE_PROJECT_signingInMemoryKey : ${{ env .SIGNING_KEY }}
103+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword : ${{ env .SIGNING_PASSWORD }}
70104
71105 # This job runs on merging to "main" branch
72106 # Creates a new tag using the value in the VERSION file
0 commit comments