-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
16 changed files
with
7,221 additions
and
81 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Decode signing key | ||
description: 'Decodes gpg key into file' | ||
inputs: | ||
signing_key_file: | ||
description: 'Signing key file' | ||
required: true | ||
default: '' | ||
signing_file_path: | ||
description: 'Signing file path' | ||
required: true | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
# After decoding the secret key, place the file in signing_file_path | ||
- run: | | ||
echo "${{inputs.signing_key_file}}" > ~/secretKey.gpg.b64 | ||
base64 -d ~/secretKey.gpg.b64 > ${{ inputs.signing_file_path }} | ||
shell: bash |
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,35 @@ | ||
name: 'Publish All Modules' | ||
description: 'Publishes all modules' | ||
inputs: | ||
sonatype_user: | ||
description: 'Sonatype user' | ||
required: true | ||
default: '' | ||
sonatype_password: | ||
description: 'Sonatype password' | ||
required: true | ||
default: '' | ||
signing_key_id: | ||
description: 'Signing key id' | ||
required: true | ||
default: '' | ||
signing_key_password: | ||
description: 'Signing key password' | ||
required: true | ||
default: '' | ||
signing_key_file: | ||
description: 'Signing key file' | ||
required: true | ||
default: '' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
./gradlew --stacktrace clean publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
shell: bash | ||
env: | ||
SONATYPE_NEXUS_USERNAME: ${{ inputs.sonatype_user }} | ||
SONATYPE_NEXUS_PASSWORD: ${{ inputs.sonatype_password }} | ||
SIGNING_KEY_ID: ${{ inputs.signing_key_id }} | ||
SIGNING_KEY_PASSWORD: ${{ inputs.signing_key_password }} | ||
SIGNING_KEY_FILE: ${{ inputs.signing_key_file }} |
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,53 @@ | ||
name: Build Demo | ||
on: | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
workflow_call: | ||
secrets: | ||
SIGNING_KEY_ID: | ||
description: 'Secret Key ID' | ||
required: true | ||
SIGNING_KEY_FILE: | ||
description: 'Secret Key' | ||
required: true | ||
SIGNING_KEY_PASSWORD: | ||
description: 'Secret Password' | ||
required: true | ||
|
||
concurrency: | ||
group: build-demo-${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-demo: | ||
name: Build Demo | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SIGNING_KEY_FILE_PATH: /home/runner/secretKey.gpg | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'microsoft' | ||
cache: gradle | ||
|
||
- name: Decode Signing Key | ||
uses: ./.github/actions/decode_signing_key_action | ||
with: | ||
signing_key_file: ${{ secrets.SIGNING_KEY_FILE }} | ||
signing_file_path: ${{ env.SIGNING_KEY_FILE_PATH }} | ||
|
||
- name: Assemble | ||
run: ./gradlew --stacktrace :demo:assemble | ||
env: | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
SIGNING_KEY_FILE: ${{ env.SIGNING_KEY_FILE_PATH }} | ||
|
||
- run: echo "Build status report=${{ job.status }}." |
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
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 |
---|---|---|
@@ -1,32 +1,31 @@ | ||
name: Release | ||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
env: | ||
SIGNING_KEY_FILE_PATH: /home/runner/secretKey.gpg | ||
|
||
jobs: | ||
lint: | ||
uses: paypal/paypal-messages-android/.github/workflows/lint.yml@release | ||
uses: ./.github/workflows/lint.yml | ||
|
||
test: | ||
uses: paypal/paypal-messages-android/.github/workflows/test.yml@release | ||
uses: ./.github/workflows/test.yml | ||
|
||
build: | ||
uses: paypal/paypal-messages-android/.github/workflows/build.yml@release | ||
uses: ./.github/workflows/build.yml | ||
secrets: | ||
SIGNING_KEY_FILE: ${{ secrets.SIGNING_KEY_FILE }} | ||
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} | ||
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
|
||
# after build and unit tests are finished, publish all modules at once | ||
# to help reduce the probability of failure when interacting with sonatype servers | ||
release: | ||
name: Release | ||
needs: [linting, tests, build] | ||
name: Publish To Maven | ||
needs: [lint, test, build] | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout repo | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
# pulls all commits (needed for semantic release to correctly version) | ||
|
@@ -37,17 +36,29 @@ jobs: | |
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: gradle | ||
distribution: 'microsoft' | ||
|
||
- name: Install Dependencies | ||
run: | | ||
npm i -g @semantic-release/exec @semantic-release/changelog @semantic-release/git [email protected] | ||
- name: Decode Signing Key | ||
uses: ./.github/actions/decode_signing_key_action | ||
with: | ||
signing_key_file: ${{ secrets.SIGNING_KEY_FILE }} | ||
signing_file_path: ${{ env.SIGNING_KEY_FILE_PATH }} | ||
|
||
- name: GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npx semantic-release@21 | ||
- name: Install Semantic Release Dependencies | ||
run: npm install | ||
|
||
# TODO: update .releaserc.json with appropriate prepareCmd, successCmd, and assets | ||
# TODO: enable semantic-release once fixed | ||
# - name: GitHub Release | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: npx semantic-release@21 | ||
|
||
- name: Publish to Maven | ||
run: echo "Publish to Maven" | ||
uses: ./.github/actions/publish_all_modules | ||
with: | ||
sonatype_user: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | ||
sonatype_password: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | ||
signing_key_id: ${{ secrets.SIGNING_KEY_ID }} | ||
signing_key_password: ${{ secrets.SIGNING_KEY_PASSWORD }} | ||
signing_key_file: ${{ env.SIGNING_KEY_FILE_PATH }} |
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
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 @@ | ||
registry=https://registry.npmjs.org |
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,64 @@ | ||
{ | ||
"branches": ["main", {"name": "develop", "prerelease": true}, {"name": "prerelease", "prerelease": true}], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ "type": "refactor", "release": "patch" }, | ||
{ "type": "perf", "release": "patch" }, | ||
{ "type": "style", "release": "patch" }, | ||
{ "type": "revert", "release": "patch" } | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ "type": "feat", "section": "Features" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "perf", "section": "Performance Improvements" }, | ||
{ "type": "revert", "section": "Reverts" }, | ||
{ "type": "docs", "section": "Documentation" }, | ||
{ "type": "style", "section": "Styles" }, | ||
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true }, | ||
{ "type": "refactor", "section": "Code Refactoring" }, | ||
{ "type": "test", "section": "Tests" }, | ||
{ "type": "build", "section": "Build System" }, | ||
{ "type": "ci", "section": "Continuous Integration" } | ||
] | ||
} | ||
} | ||
], | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogTitle": "# Changelog" | ||
} | ||
], | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "", | ||
"successCmd": "" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["*"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": "" | ||
} | ||
] | ||
] | ||
} |
Oops, something went wrong.