From 5affd724684883b8342256b51088a086520950e2 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 31 Oct 2024 18:38:35 +0530 Subject: [PATCH] Refactored our CD to get the secrets. * Changed the `upload-artifact` version to 4 since it was giving error. --- .github/workflows/cd.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 711e53b..f7f8047 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,6 +5,9 @@ on: types: [published] branches: - main + push: + tags: + - 'dwds' jobs: publish: @@ -32,14 +35,18 @@ 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: Preparing signing material env: keystore: ${{ secrets.keystore }} playstore_json: ${{ secrets.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] || '' }} + non_kiwix_playstore_json=${{ secrets[env.NON_KIWIX_ORGANIZATION_TAG] || '' }} if [ -n "$non_kiwix_playstore_json" ]; then echo "$non_kiwix_playstore_json" > kiwix-android/playstore.json else @@ -135,7 +142,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 }}