diff --git a/.github/workflows/appimage-release.yml b/.github/workflows/appimage-release.yml index 2cdbfcd..417d210 100644 --- a/.github/workflows/appimage-release.yml +++ b/.github/workflows/appimage-release.yml @@ -499,26 +499,36 @@ jobs: if: > github.event.client_payload.options.update && github.event.client_payload.options.packer + shell: python3 {0} run: | - cd $REPO_NAME/.. - mkdir DesktopPrivate - cd DesktopPrivate + import os + p = os.environ["REPO_NAME"]+"/../DesktopPrivate" + os.mkdir(p) + os.chdir(p) - echo " - const char *PrivateKey = \"\\ - -----BEGIN RSA PRIVATE KEY-----\\n\\ + keys_contents = r""" + const char *PrivateKey = "\ + -----BEGIN RSA PRIVATE KEY-----\n\ ${{ secrets.PACKER_PRIVATE_KEY }} - -----END RSA PRIVATE KEY-----\\ - \"; + -----END RSA PRIVATE KEY-----\ + "; - const char *PrivateBetaKey = \"\\ - -----BEGIN RSA PRIVATE KEY-----\\n\\ + const char *PrivateBetaKey = "\ + -----BEGIN RSA PRIVATE KEY-----\n\ ${{ secrets.PACKER_PRIVATE_BETA_KEY }} - -----END RSA PRIVATE KEY-----\\ - \"; - " > packer_private.h + -----END RSA PRIVATE KEY-----\ + "; + """ - echo "\nconst char *AlphaPrivateKey = \"\";\n" > alpha_private.h + alpha_contents = r""" + const char *AlphaPrivateKey = ""; + """ + + with open("packer_private.h", "w", encoding="utf-8") as f: + f.write(keys_contents) + + with open("alpha_private.h", "w", encoding="utf-8") as f: + f.write(alpha_contents) - name: Kotatogram Desktop build. if: env.ONLY_CACHE == 'false' diff --git a/.github/workflows/win-release.yml b/.github/workflows/win-release.yml index 3c7b82b..a220aa3 100644 --- a/.github/workflows/win-release.yml +++ b/.github/workflows/win-release.yml @@ -251,32 +251,49 @@ jobs: cd .. rmdir /S /Q qt_%QT% + + - name: Setup Python 3.x + if: > + github.event.client_payload.options.update + && github.event.client_payload.options.packer + uses: actions/setup-python@v2 + with: + python-version: '3.x' - name: Setting up updater keys. if: > github.event.client_payload.options.update && github.event.client_payload.options.packer - shell: bash + shell: python run: | - cd $REPO_NAME/.. - mkdir DesktopPrivate - cd DesktopPrivate - - echo " - const char *PrivateKey = \"\\ - -----BEGIN RSA PRIVATE KEY-----\\n\\ + import os + p = os.environ["REPO_NAME"]+"/../DesktopPrivate" + os.mkdir(p) + os.chdir(p) + + keys_contents = r""" + const char *PrivateKey = "\ + -----BEGIN RSA PRIVATE KEY-----\n\ ${{ secrets.PACKER_PRIVATE_KEY }} - -----END RSA PRIVATE KEY-----\\ - \"; + -----END RSA PRIVATE KEY-----\ + "; - const char *PrivateBetaKey = \"\\ - -----BEGIN RSA PRIVATE KEY-----\\n\\ + const char *PrivateBetaKey = "\ + -----BEGIN RSA PRIVATE KEY-----\n\ ${{ secrets.PACKER_PRIVATE_BETA_KEY }} - -----END RSA PRIVATE KEY-----\\ - \"; - " > packer_private.h + -----END RSA PRIVATE KEY-----\ + "; + """ - echo "\nconst char *AlphaPrivateKey = \"\";\n" > alpha_private.h + alpha_contents = r""" + const char *AlphaPrivateKey = ""; + """ + + with open("packer_private.h", "w", encoding="utf-8") as f: + f.write(keys_contents) + + with open("alpha_private.h", "w", encoding="utf-8") as f: + f.write(alpha_contents) - name: Kotatogram Desktop build. if: env.ONLY_CACHE == 'false' @@ -343,14 +360,6 @@ jobs: asset_path: ./${{ env.REPO_NAME }}/artifact/${{ env.ARTIFACT_NAME }} asset_name: ${{ env.ARTIFACT_NAME }} asset_content_type: application/octet-stream - - - name: Setup Python 3.x - if: > - env.ONLY_CACHE == 'false' - && github.event.client_payload.options.telegram - uses: actions/setup-python@v2 - with: - python-version: '3.x' - name: Install dependencies for Telegram uploader. if: >