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
13 changes: 5 additions & 8 deletions .github/actions/android/prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@ inputs:
SONATA_PASSWORD:
description: sonata password
required: true
SONATYPE_REES46:
description: sonatype for rees46
SONATYPE_PERSONACLICK:
description: sonatype for personaclick
SONATA_STAGING_PROFILE_ID:
description: sonata staging profile id
required: true
OSSRH_PASSWORD:
description: ossrhPassword
required: true
Expand Down Expand Up @@ -76,8 +75,7 @@ runs:
OSSRH_PASSWORD: ${{ inputs.OSSRH_PASSWORD }}
SONATA_USERNAME: ${{ inputs.SONATA_USERNAME }}
SONATA_PASSWORD: ${{ inputs.SONATA_PASSWORD }}
SONATYPE_REES46: ${{ inputs.SONATYPE_REES46 }}
SONATYPE_PERSONACLICK: ${{ inputs.SONATYPE_PERSONACLICK }}
SONATA_STAGING_PROFILE_ID: ${{ inputs.SONATA_STAGING_PROFILE_ID }}
SIGNING_KEY_ID: ${{ inputs.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ inputs.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE }}
Expand All @@ -89,8 +87,7 @@ runs:
echo "ossrhPassword=$OSSRH_PASSWORD" >> $PROPERTIES_FILE
echo "sonataUsername=$SONATA_USERNAME" >> $PROPERTIES_FILE
echo "sonataPassword=$SONATA_PASSWORD" >> $PROPERTIES_FILE
echo "sonatype_rees46=$SONATYPE_REES46" >> $PROPERTIES_FILE
echo "sonatype_personaclick=$SONATYPE_PERSONACLICK" >> $PROPERTIES_FILE
echo "stagingProfileId=$SONATA_STAGING_PROFILE_ID" >> $PROPERTIES_FILE
echo "signing_keyId=$SIGNING_KEY_ID" >> $PROPERTIES_FILE
echo "signing_password=$SIGNING_PASSWORD" >> $PROPERTIES_FILE
echo "signing_secretKeyRingFile=$SIGNING_SECRET_KEY_RING_FILE" >> $PROPERTIES_FILE
Expand Down
87 changes: 78 additions & 9 deletions .github/workflows/reusable-android-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Reusable Android SDK publish to Sona
on:
workflow_call:
inputs:
appId:
required: true
type: string
description: 'App ID for committing and pushing'
PROPERTIES_FILE:
default: gradle.properties
type: string
Expand Down Expand Up @@ -38,8 +42,12 @@ on:
type: string
default: 'github-bot@rees46.com'
secrets:
appSecret:
required: true
SONATA_USERNAME:
required: true
SONATA_STAGING_PROFILE_ID:
required: true
SONATA_PASSWORD:
required: true
OSSRH_PASSWORD:
Expand All @@ -50,21 +58,23 @@ on:
required: true
SIGNING_KEY_FILE_AS_BASE64_STRING:
required: true
SONATYPE_REES46:
required: true
SONATYPE_PERSONACLICK:
required: true

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ inputs.appId }}
private-key: ${{ secrets.appSecret }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.OSSRH_PASSWORD }}
ref: master
token: ${{ steps.app-token.outputs.token }}
branch: master

- name: Prepare Android Action
uses: rees46/workflow/.github/actions/android/prepare@master
Expand All @@ -79,11 +89,70 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }}
SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }}
SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }}
SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }}
SONATA_STAGING_PROFILE_ID: ${{ secrets.SONATA_STAGING_PROFILE_ID }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }}

- name: Publish
run: ./gradlew publish
run: |
./gradlew publish

- name: Install xmllint
run: |
sudo apt-get update
sudo apt-get install -y libxml2-utils

- name: Debug profile id
run: |
echo ${{ secrets.SONATA_STAGING_PROFILE_ID }}

- name: Get repos.xml
id: get_repos
run: |
REPOS=$(curl -s -u ${{ secrets.SONATA_USERNAME }}:${{ secrets.SONATA_PASSWORD }} https://s01.oss.sonatype.org/service/local/staging/profile_repositories/${{ secrets.SONATA_STAGING_PROFILE_ID }})
echo "REPOS: $REPOS"
echo "$REPOS" > repos.xml

- name: Extract repository IDs
id: extract_ids
run: |
repository_ids=($(xmllint --xpath '//repositoryId/text()' repos.xml))
echo "Repository IDs: ${repository_ids[@]}"
echo "repository_ids=${repository_ids[*]}" >> $GITHUB_OUTPUT

- name: Close stages
run: |
IFS=' ' read -r -a ids_array <<< "${{ steps.extract_ids.outputs.repository_ids }}"

for id in "${ids_array[@]}"; do
curl -X POST \
-u "${{ secrets.SONATA_USERNAME }}":"${{ secrets.SONATA_PASSWORD }}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"stagedRepositoryId": '$id'
}
}' \
"https://s01.oss.sonatype.org/service/local/staging/profiles/${{ secrets.SONATA_STAGING_PROFILE_ID }}/finish"
done

- name: Sleep 5 minutes
run: |
sleep 300

- name: Release stages
run: |
IFS=' ' read -r -a ids_array <<< "${{ steps.extract_ids.outputs.repository_ids }}"

for id in "${ids_array[@]}"; do
curl -X POST \
-u "${{ secrets.SONATA_USERNAME }}":"${{ secrets.SONATA_PASSWORD }}" \
-H "Content-Type: application/json" \
-d '{
"data": {
"stagedRepositoryId": '$id'
}
}' \
"https://s01.oss.sonatype.org/service/local/staging/profiles/${{ secrets.SONATA_STAGING_PROFILE_ID }}/promote"
done
71 changes: 1 addition & 70 deletions .github/workflows/reusable-android-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,7 @@ on:
required: true
type: string
description: 'App ID for committing and pushing'
PROPERTIES_FILE:
default: gradle.properties
type: string
description: Relative file path for putting in secrets
required: false
SIGNING_SECRET_KEY_RING_FILE:
default: com.rees46.key.gpg
type: string
description: Location and name for signature file
required: false
SIGNING_SECRET_KEY_RING_FILE_LOCATION:
type: string
description: Location and name for signature file
required: true
GRADLE_VERSION:
type: number
required: false
VARIANT_NAME:
description: REES46 or PersonaClick
type: string
required: true
URL:
description: GitHub repo URL
type: string
required: true
MAVEN_REPOSITORY_URL:
description: Maven repository publish to
type: string
required: true
OSSRH_USERNAME:
required: false
type: string
default: 'github-bot@rees46.com'

secrets:
SONATA_USERNAME:
required: true
SONATA_PASSWORD:
required: true
SONATYPE_REES46:
required: true
SONATYPE_PERSONACLICK:
required: true
OSSRH_PASSWORD:
required: true
SIGNING_KEY_ID:
required: true
SIGNING_PASSWORD:
required: true
SIGNING_KEY_FILE_AS_BASE64_STRING:
required: true
appSecret:
required: true

Expand All @@ -76,26 +26,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
ref: master

- name: Prepare Android Action
uses: rees46/workflow/.github/actions/android/prepare@master
with:
PROPERTIES_FILE: ${{ inputs.PROPERTIES_FILE }}
SIGNING_SECRET_KEY_RING_FILE: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE }}
SIGNING_SECRET_KEY_RING_FILE_LOCATION: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE_LOCATION }}
VARIANT_NAME: ${{ inputs.VARIANT_NAME }}
URL: ${{ inputs.URL }}
MAVEN_REPOSITORY_URL: ${{ inputs.MAVEN_REPOSITORY_URL }}
OSSRH_USERNAME: ${{ inputs.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATA_USERNAME: ${{ secrets.SONATA_USERNAME }}
SONATA_PASSWORD: ${{ secrets.SONATA_PASSWORD }}
SONATYPE_PERSONACLICK: ${{ secrets.SONATYPE_PERSONACLICK }}
SONATYPE_REES46: ${{ secrets.SONATYPE_REES46 }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY_FILE_AS_BASE64_STRING: ${{ secrets.SIGNING_KEY_FILE_AS_BASE64_STRING }}
branch: master

- name: Retrieve version
id: versionName
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-android-synchronization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Get current version from source
working-directory: source
env:
FILE_PATH: "version.properties"
FILE_PATH: 'version.properties'
id: version_source
run: |
current_version=$(awk -F"=" '/VERSION_NAME/ {print $2}' "$FILE_PATH")
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/reusable-android-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
appId:
required: true
type: string
description: "App ID for committing and pushing"
description: 'App ID for committing and pushing'
secrets:
appSecret:
required: true
Expand All @@ -28,6 +28,7 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
branch: master

- name: Patch version
run: ./gradlew personalization-sdk:increaseVersionCode
Expand All @@ -49,5 +50,5 @@ jobs:
with:
repo: ${{ github.repository }}
branch: master
commit_message: "chore(common): version bump to ${{ steps.versionName.outputs.versionName }}"
file_pattern: "personalization-sdk"
commit_message: 'chore(common): version bump to ${{ steps.versionName.outputs.versionName }}'
file_pattern: 'personalization-sdk'
6 changes: 3 additions & 3 deletions .github/workflows/reusable-ios-synchronization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Sync iOS Repositories

env:
WORKFLOW_REPO: "rees46/workflow"
WORKFLOW_REPO: 'rees46/workflow'

on:
workflow_call:
Expand All @@ -12,11 +12,11 @@ on:
targetRepository:
type: string
required: true
default: "Target repository"
default: 'Target repository'
versionFilePath:
type: string
required: true
default: "version.properties"
default: 'version.properties'

jobs:
run:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/reusable-ios-testflight-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Reusable iOS TestFlight Publish

env:
WORKFLOW_REPO: "rees46/workflow"
ARCHIVE_EXPORT_PATH: "./build/exported-app"
EXPORT_OPTIONS_PLIST_PATH: "./ExportOptions.plist"
PROPERTIES_FILE: "version.properties"
WORKFLOW_REPO: 'rees46/workflow'
ARCHIVE_EXPORT_PATH: './build/exported-app'
EXPORT_OPTIONS_PLIST_PATH: './ExportOptions.plist'
PROPERTIES_FILE: 'version.properties'

on:
workflow_call:
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Upload to TestFlight
uses: Apple-Actions/upload-testflight-build@master
with:
app-path: "${{ env.ARCHIVE_EXPORT_PATH }}/${{ inputs.scheme }}.ipa"
app-path: '${{ env.ARCHIVE_EXPORT_PATH }}/${{ inputs.scheme }}.ipa'
issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
api-key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
api-private-key: ${{ secrets.APP_STORE_CONNECT_API_KEY }}
6 changes: 3 additions & 3 deletions .github/workflows/reusable-multiplatform-bump.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Reusable multiplatform bump

env:
WORKFLOW_REPO: "rees46/workflow"
PROPERTIES_FILE: "version.properties"
WORKFLOW_REPO: 'rees46/workflow'
PROPERTIES_FILE: 'version.properties'

on:
workflow_call:
Expand Down Expand Up @@ -58,5 +58,5 @@ jobs:
with:
repo: ${{ github.repository }}
branch: master
commit_message: "chore: bump version to ${{ steps.versionName.outputs.versionName }}"
commit_message: 'chore: bump version to ${{ steps.versionName.outputs.versionName }}'
file_pattern: ${{ env.PROPERTIES_FILE }}
10 changes: 10 additions & 0 deletions .local/scripts/replacement.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SYNC_IGNORE=".git,.idea,.gitignore,LICENSE,.github/workflows/synchronization.yaml"

IFS=',' read -r -a ignored_files <<< "$SYNC_IGNORE"

exclude_conditions=""
for ignored_file in "${ignored_files[@]}"; do
exclude_conditions="$exclude_conditions ! -name \"$ignored_file\""
done

echo $exclude_conditions
3 changes: 3 additions & 0 deletions .vim/coc-settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "disabled"
}