file path gets overriden during the upload
Closed this issue · 7 comments
dinisnunes1 commented
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
muhamedzeema commented
@dinisnunes1 I will check it tomorrow morning and get back to you
dinisnunes1 commented
@muhamedzeema I beleive it's this line https://github.com/muhamedzeema/appgallery-deply-action/blob/main/index.js#L130 as the file name is hardcoded.
dinisnunes1 commented
@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.
muhamedzeema commented
@dinisnunes1 great ideas, would you like to make those changes and creating a PR for it ?
dinisnunes1 commented
@muhamedzeema opened the PR with the proposed changes. #5
muhamedzeema commented
Thank youuuu.
dinisnunes1 commented
@muhamedzeema can you create a tag for it?