Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a6bc34c
gradle files
grablack Nov 20, 2023
fd1f625
add github action
grablack Nov 20, 2023
e0a68c4
add properties
grablack Nov 20, 2023
068748e
manual versions
grablack Dec 1, 2023
b26570a
builldType release
grablack Dec 1, 2023
3e2c56c
inside android
grablack Dec 1, 2023
c9f24f3
copy buildtype structure
grablack Dec 1, 2023
03c10b5
remove unneeded edits
grablack Dec 5, 2023
0141739
rename
grablack Dec 6, 2023
31c1524
remove plugin
grablack Dec 6, 2023
82ce7fa
update name
grablack Dec 6, 2023
8d70d51
update build
grablack Dec 8, 2023
2baa4c1
signing plugin
grablack Dec 11, 2023
ead9d89
remove
grablack Dec 11, 2023
683d9fd
uncomment
grablack Dec 12, 2023
f4dced6
change case
grablack Dec 12, 2023
c4bbffb
Merge branch 'develop' into feat/pre-release-pack-2627
grablack Dec 13, 2023
d4cae59
build w gradle is same as assemble
grablack Dec 13, 2023
073dcb7
update version
grablack Dec 13, 2023
bb8fb9a
copy over build_aar
grablack Dec 13, 2023
f31b56a
remove input and build_aar
grablack Dec 13, 2023
e903ddb
no secret
grablack Dec 14, 2023
3a4945f
remove branch name
grablack Dec 14, 2023
32c1d97
use this branchname
grablack Dec 14, 2023
6195470
try local path
grablack Dec 14, 2023
170a48f
empty workflow_call
grablack Dec 14, 2023
5f469c7
local with branch
grablack Dec 14, 2023
a96670a
back to release
grablack Dec 14, 2023
048a30a
dont call as local
grablack Dec 14, 2023
96e0f5d
back to local
grablack Dec 14, 2023
706fce2
add push
grablack Dec 14, 2023
fc7bc24
add workflow_call
grablack Dec 15, 2023
a186dbd
allow secrets
grablack Dec 15, 2023
ce4c870
require
grablack Dec 15, 2023
48b7f3f
pass secrets
grablack Dec 15, 2023
5796291
update java version
grablack Dec 15, 2023
df28180
try fix dep
grablack Dec 18, 2023
70d7b12
task for dependency
grablack Dec 18, 2023
0ec0588
as input
grablack Dec 18, 2023
89c7a04
comment out
grablack Dec 18, 2023
cbd35e5
no artifact
grablack Dec 18, 2023
31a8005
add subproject
grablack Dec 18, 2023
265dcea
update ext name
grablack Dec 19, 2023
84e58b8
remove namespace
grablack Dec 19, 2023
639efbb
keep namespace
grablack Dec 19, 2023
2482aea
update url
grablack Dec 19, 2023
4e8ba41
specifiy the urls
grablack Dec 19, 2023
a3ae992
update urls
grablack Dec 19, 2023
a9fe7d2
change name back
grablack Dec 19, 2023
e5d0a4d
update url
grablack Dec 19, 2023
d7f2160
add snapshots
grablack Dec 19, 2023
b39a163
remove commented section
grablack Dec 19, 2023
e70fc54
attempt deploy without url
grablack Dec 20, 2023
d398c64
restore artifact line
grablack Dec 20, 2023
1f3723d
add artifact back
grablack Dec 20, 2023
7ebcde0
bring back task
grablack Dec 20, 2023
336d203
try variant
grablack Dec 20, 2023
13bfa58
restore to working
grablack Dec 20, 2023
f745ebc
try adding repo
grablack Dec 20, 2023
9fa5c5d
try new push
grablack Dec 20, 2023
03f18f3
unused buildscript
grablack Jan 8, 2024
fbf3d68
update names
grablack Jan 8, 2024
eb9c78e
distribution and yml changes
grablack Jan 8, 2024
f8f4315
split out demo build
grablack Jan 8, 2024
4926e94
unify version
grablack Jan 8, 2024
c74f8d6
make builds diff group
grablack Jan 8, 2024
f12bc80
use same var
grablack Jan 8, 2024
e674538
Add further fixes
merlinpaypal Jan 10, 2024
06bc1f1
update name
grablack Jan 11, 2024
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
19 changes: 19 additions & 0 deletions .github/actions/decode_signing_key_action/action.yml
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
35 changes: 35 additions & 0 deletions .github/actions/publish_all_modules/action.yml
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 }}
53 changes: 53 additions & 0 deletions .github/workflows/build-demo.yml
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 }}."
41 changes: 31 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
name: Build
on: [pull_request, workflow_dispatch]
name: Build Library
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-${{ github.event.number }}
cancel-in-progress: true

jobs:
build:
name: Build
name: Build Library
runs-on: ubuntu-latest

strategy:
matrix:
codebase: [library, demo]
env:
SIGNING_KEY_FILE_PATH: /home/runner/secretKey.gpg

steps:
- name: Checkout repo
Expand All @@ -22,11 +34,20 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'microsoft'
cache: gradle

# Only library assets are needed for the build step
- name: Build with Gradle
run: ./gradlew :${{ matrix.codebase }}:assemble
- 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 :library: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 }}."
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Lint
on: [pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch, workflow_call]

concurrency:
group: lint-${{ github.event.number }}
Expand All @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'microsoft'
cache: gradle

- name: Run Lint
Expand Down
61 changes: 36 additions & 25 deletions .github/workflows/release.yml
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)
Expand All @@ -37,17 +36,29 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
distribution: 'microsoft'
Copy link
Contributor

@merlinpaypal merlinpaypal Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm checking with Steven on the difference but if we're updating the distribution here, we should probably update it everywhere for consistency

Steven said it shouldn't matter which one we use, but since that team is using Microsoft, let's switch it everywhere to Microsoft

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good


- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want to keep a GitHub release in line with our published packages, so these should stick around in some fashion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added back

- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it says "Publish to Maven" but above it says "Publish to Sonatype". Why the difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I didn't see name when I updated it. I'll make them align

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 }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Test
on: [pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch, workflow_call]

concurrency:
group: test-${{ github.event.number }}
Expand All @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
distribution: 'microsoft'
cache: gradle

- name: Run Tests
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
.cxx
local.properties

# Node
node_modules/

# Recommended Ignores by JetBrains
# https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# .idea/ files are handled in .idea/.gitignore
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
64 changes: 64 additions & 0 deletions .releaserc.json
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": ""
}
]
]
}
Loading