diff --git a/.github/actions/android/prepare/action.yaml b/.github/actions/android/prepare/action.yaml index 419e2d83..3a25cec9 100644 --- a/.github/actions/android/prepare/action.yaml +++ b/.github/actions/android/prepare/action.yaml @@ -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 @@ -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 }} @@ -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 diff --git a/.github/workflows/reusable-android-publish.yaml b/.github/workflows/reusable-android-publish.yaml index d0b556a8..c0f99e00 100644 --- a/.github/workflows/reusable-android-publish.yaml +++ b/.github/workflows/reusable-android-publish.yaml @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/reusable-android-release.yaml b/.github/workflows/reusable-android-release.yaml index 3aa83453..5c21a530 100644 --- a/.github/workflows/reusable-android-release.yaml +++ b/.github/workflows/reusable-android-release.yaml @@ -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 @@ -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 diff --git a/.github/workflows/reusable-android-synchronization.yaml b/.github/workflows/reusable-android-synchronization.yaml index d40e690a..e31ab271 100644 --- a/.github/workflows/reusable-android-synchronization.yaml +++ b/.github/workflows/reusable-android-synchronization.yaml @@ -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") diff --git a/.github/workflows/reusable-android-version.yaml b/.github/workflows/reusable-android-version.yaml index 6c3dfd09..13b38128 100644 --- a/.github/workflows/reusable-android-version.yaml +++ b/.github/workflows/reusable-android-version.yaml @@ -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 @@ -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 @@ -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' diff --git a/.github/workflows/reusable-ios-synchronization.yaml b/.github/workflows/reusable-ios-synchronization.yaml index 048f7f4c..a9065dc1 100644 --- a/.github/workflows/reusable-ios-synchronization.yaml +++ b/.github/workflows/reusable-ios-synchronization.yaml @@ -1,7 +1,7 @@ name: Sync iOS Repositories env: - WORKFLOW_REPO: "rees46/workflow" + WORKFLOW_REPO: 'rees46/workflow' on: workflow_call: @@ -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: diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index a480917d..27998992 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -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: @@ -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 }} diff --git a/.github/workflows/reusable-multiplatform-bump.yaml b/.github/workflows/reusable-multiplatform-bump.yaml index 758fa33e..8f894393 100644 --- a/.github/workflows/reusable-multiplatform-bump.yaml +++ b/.github/workflows/reusable-multiplatform-bump.yaml @@ -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: @@ -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 }} diff --git a/.local/scripts/replacement.sh b/.local/scripts/replacement.sh new file mode 100755 index 00000000..e22f0977 --- /dev/null +++ b/.local/scripts/replacement.sh @@ -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 diff --git a/.vim/coc-settings.json b/.vim/coc-settings.json new file mode 100644 index 00000000..7b3712b0 --- /dev/null +++ b/.vim/coc-settings.json @@ -0,0 +1,3 @@ +{ + "java.compile.nullAnalysis.mode": "disabled" +}