diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 711e53b..7b40af5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,9 +2,12 @@ name: CD on: release: - types: [published] + types: [ published ] branches: - main + push: + tags: + - 'testing_dwds' jobs: publish: @@ -32,19 +35,26 @@ jobs: - name: Install jq run: sudo apt-get install -y jq + - name: Set non-kiwix organization tag + run: | + non_kiwix_organization_tag="PLAYSTORE_JSON_${TAG}" + echo "NON_KIWIX_ORGANIZATION_TAG=${non_kiwix_organization_tag}" >> $GITHUB_ENV + + - name: Determine playstore.json file + run: | + if [ -n "${{ secrets[env.NON_KIWIX_ORGANIZATION_TAG] }}" ]; then + echo "CUSTOM_PLAYSTORE_JSON=${{ secrets[env.NON_KIWIX_ORGANIZATION_TAG] }}" >> $GITHUB_ENV + else + echo "CUSTOM_PLAYSTORE_JSON=${{ secrets.PLAYSTORE_JSON }}" >> $GITHUB_ENV + fi + - name: Preparing signing material env: keystore: ${{ secrets.keystore }} - playstore_json: ${{ secrets.PLAYSTORE_JSON }} + playstore_json: ${{ env.CUSTOM_PLAYSTORE_JSON }} run: | echo "$keystore" | base64 -d > kiwix-android/kiwix-android.keystore - non_kiwix_organization_tag='PLAYSTORE_JSON_'${TAG} - non_kiwix_playstore_json=${{ secrets[non_kiwix_organization_tag] || '' }} - if [ -n "$non_kiwix_playstore_json" ]; then - echo "$non_kiwix_playstore_json" > kiwix-android/playstore.json - else - echo "$playstore_json" > kiwix-android/playstore.json - fi + echo "$playstore_json" > kiwix-android/playstore.json - name: Should upload Bundle run: | @@ -135,7 +145,7 @@ jobs: - name: Upload Bundle as an artifact if: env.should_publish == 'true' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ env.bundle_name }} path: ${{ env.bundle_path }}