Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 38 additions & 12 deletions sdks/dotnet/.github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This workflow will build the project, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.
# Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC.

name: Build, Check, Publish

Expand All @@ -13,22 +12,44 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Configure AWS credentials for Docker Hub secrets (OIDC)
if: github.event_name != 'pull_request'
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::301904545275:role/oidc-github-hellosign-dropbox-sign-dotnet-branch-main
aws-region: us-west-2

- name: Get Docker Hub secrets from AWS Secrets Manager
if: github.event_name != 'pull_request'
uses: aws-actions/aws-secretsmanager-get-secrets@v3
with:
secret-ids: |
DOCKER_USERNAME,github-actions/hellosign/shared/docker-username
DOCKER_TOKEN,github-actions/hellosign/shared/docker-token
parse-json-secrets: false

- name: Build SDK
run: ./run-build
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}}

- name: Ensure no changes in Generated Code
run: ./bin/check-clean-git-status

publish:
runs-on: ubuntu-latest
if: github.repository == 'hellosign/dropbox-sign-dotnet'
permissions:
contents: read
id-token: write
if: >-
github.repository == 'hellosign/dropbox-sign-dotnet'
&& github.ref == 'refs/heads/main'
&& github.event_name != 'pull_request'
needs: [ build ]
env:
BUILD_CONFIG: 'Release'
Expand All @@ -54,13 +75,18 @@ jobs:
- name: Run pack
run: dotnet pack --configuration ${BUILD_CONFIG} ${SOLUTION}.sln

# This runs on merging to "main" branch
# Builds and publishes package to nuget.org
- name: NuGet login with trusted publishing
uses: NuGet/login@v1
id: nuget-login
with:
user: HelloSign

- name: Publish to nuget
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: dotnet nuget push src/${SOLUTION}/bin/Release/*.nupkg -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: >-
dotnet nuget push
src/${SOLUTION}/bin/Release/*.nupkg
--api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }}
--source https://api.nuget.org/v3/index.json

# This job runs on merging to "main" branch
# Creates a new tag using the value in the VERSION file
Expand Down
30 changes: 26 additions & 4 deletions sdks/java-v1/.github/workflows/close-and-release-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ on:

jobs:
closeAndReleaseRepository:
if: >-
github.repository == 'hellosign/dropbox-sign-java'
&& github.ref == 'refs/heads/v1'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,10 +25,26 @@ jobs:
distribution: 'zulu'
java-version: 11

- name: Configure AWS credentials for Maven secrets (OIDC)
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::521590706193:role/oidc-github-hellosign-dropbox-sign-java-branch-v1
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 to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}
60 changes: 47 additions & 13 deletions sdks/java-v1/.github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This workflow will build the project, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.
# Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC.

name: Build, Check, Publish

Expand All @@ -15,15 +14,31 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Configure AWS credentials for Docker Hub secrets (OIDC)
if: github.event_name != 'pull_request'
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::301904545275:role/oidc-github-hellosign-dropbox-sign-java-branch-v1
aws-region: us-west-2

- name: Get Docker Hub secrets from AWS Secrets Manager
if: github.event_name != 'pull_request'
uses: aws-actions/aws-secretsmanager-get-secrets@v3
with:
secret-ids: |
DOCKER_USERNAME,github-actions/hellosign/shared/docker-username
DOCKER_TOKEN,github-actions/hellosign/shared/docker-token
parse-json-secrets: false

- name: Build SDK
run: ./run-build
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}}

- name: Ensure no changes in Generated Code
run: ./bin/check-clean-git-status
Expand All @@ -37,6 +52,9 @@ jobs:
&& github.ref == 'refs/heads/v1'
&& github.event_name != 'pull_request'
needs: [ build ]
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -50,23 +68,39 @@ jobs:
- name: Retrieve version
run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Configure AWS credentials for Maven secrets (OIDC)
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::521590706193:role/oidc-github-hellosign-dropbox-sign-java-branch-v1
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 to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}

- name: Publish Snapshot
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}

# This job runs on merging to "v1" branch
# Creates a new tag using the value in the VERSION file
Expand Down
30 changes: 26 additions & 4 deletions sdks/java-v2/.github/workflows/close-and-release-repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ on:

jobs:
closeAndReleaseRepository:
if: >-
github.repository == 'hellosign/dropbox-sign-java'
&& github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,10 +25,26 @@ jobs:
distribution: 'zulu'
java-version: 11

- name: Configure AWS credentials for Maven secrets (OIDC)
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::521590706193:role/oidc-github-hellosign-dropbox-sign-java-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 to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}
60 changes: 47 additions & 13 deletions sdks/java-v2/.github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This workflow will build the project, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.
# Secret-backed jobs fetch credentials from AWS Secrets Manager using GitHub OIDC.

name: Build, Check, Publish

Expand All @@ -15,15 +14,31 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Configure AWS credentials for Docker Hub secrets (OIDC)
if: github.event_name != 'pull_request'
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::301904545275:role/oidc-github-hellosign-dropbox-sign-java-branch-main
aws-region: us-west-2

- name: Get Docker Hub secrets from AWS Secrets Manager
if: github.event_name != 'pull_request'
uses: aws-actions/aws-secretsmanager-get-secrets@v3
with:
secret-ids: |
DOCKER_USERNAME,github-actions/hellosign/shared/docker-username
DOCKER_TOKEN,github-actions/hellosign/shared/docker-token
parse-json-secrets: false

- name: Build SDK
run: ./run-build
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_TOKEN: ${{secrets.DOCKER_TOKEN}}

- name: Ensure no changes in Generated Code
run: ./bin/check-clean-git-status
Expand All @@ -37,6 +52,9 @@ jobs:
&& github.ref == 'refs/heads/main'
&& github.event_name != 'pull_request'
needs: [ build ]
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -50,23 +68,39 @@ jobs:
- name: Retrieve version
run: echo "PACKAGE_VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Configure AWS credentials for Maven secrets (OIDC)
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: arn:aws:iam::521590706193:role/oidc-github-hellosign-dropbox-sign-java-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 to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
if: "!endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}

- name: Publish Snapshot
run: ./gradlew publishToMavenCentral --no-daemon --no-parallel --no-configuration-cache --stacktrace
if: "endsWith(env.PACKAGE_VERSION, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
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 }}

# This job runs on merging to "main" branch
# Creates a new tag using the value in the VERSION file
Expand Down
Loading
Loading