muhamedzeema/appgallery-deply-action

file path gets overriden during the upload

Closed this issue · 7 comments

I'm using this action to upload to AppGallery, the apk is uploaded but the filename is always overriden on AppGallery and is always shown as app-release.apk

Example of the used config

 - name: Deploy to Huawei App Gallery
   uses: muhamedzeema/appgallery-deply-action@main
   with:
      client-id: ${{secrets.HUAWEI_CLIENT_ID}}
      client-key: ${{secrets.HUAWEI_CLIENT_KEY}}
      app-id: ${{secrets.HUAWEI_APP_ID}}
      file-extension: "apk"
      file-path: "path/android_test_universal.apk"
      submit: false

Screenshot 2022-01-10 at 15 58 02

@dinisnunes1 I will check it tomorrow morning and get back to you

@muhamedzeema quick fix could be:
Option 1

  • Add a new Input (can be optional), something like:
- name: Deploy to Huawei App Gallery
  uses: muhamedzeema/appgallery-deply-action@main
  with:
    client-id: ${{secrets.HUAWEI_CLIENT_ID}}
    client-key: ${{secrets.HUAWEI_CLIENT_KEY}}
    app-id: ${{secrets.HUAWEI_APP_ID}}
    file-extension: "apk"
    file-path: "apk/release/app-release.apk"
    file-name: "Example-of-my-app-file-name"
    submit: true

and then edit the function updateAppFileInfo

function updateAppFileInfo({ fileDestUrl, size, appId, clientId, token, fileName, fileExt }) {
  console.log("Update App File Info .... ⌛️");
  var binaryName = 'app-release'
  if (typeOf(fileName) != 'undefined' && fileName != '') {
      binaryName = fileName
  }
  var data = JSON.stringify({
    fileType: "5",
    files: [
      {
        fileName: `${binaryName}.${fileExt}`,
        fileDestUrl: fileDestUrl,
        size,
      },
    ],
  });

Option 2

  • Extract the file name as a substring between the / chat and the extension file. Example for
    file-path: "apk/release/app-release.apk"
    try to extract between last / char and the .apk text.

@dinisnunes1 great ideas, would you like to make those changes and creating a PR for it ?

@muhamedzeema opened the PR with the proposed changes. #5

Thank youuuu.

@muhamedzeema can you create a tag for it?