7878 uses : actions/upload-artifact@v4
7979 with :
8080 name : Android-AAB
81- path : ${{ github.workspace }}\publish\App.aab # Changed to backslashes
81+ path : ${{ github.workspace }}\publish\App.aab
8282 overwrite : true
8383
8484 deploy-android :
9090 - name : Download Android AAB
9191 uses : actions/download-artifact@v4
9292 with :
93- name : Android-AAB # Changed from pattern to name
93+ name : Android-AAB
9494 path : ${{ github.workspace }}\artifacts
9595
9696 - name : Debug - List downloaded files
@@ -107,63 +107,49 @@ jobs:
107107 Write-Host "No AAB files found in artifacts directory."
108108 }
109109
110- - name : Prepare AAB for upload
110+ # 🚨 CRITICAL FIX: Prepare files in working directory with relative paths
111+ - name : Prepare files for upload
111112 shell : pwsh
112113 run : |
113- $publishDir = Join-Path "${{ github.workspace }}" 'publish'
114+ # Create publish directory in working directory (not full path)
115+ $publishDir = "publish"
114116 if (!(Test-Path $publishDir)) { New-Item -ItemType Directory -Path $publishDir | Out-Null }
115117
118+ # Find and copy AAB file to working directory
116119 $aabFile = Get-ChildItem -Recurse "${{ github.workspace }}\artifacts" -Filter "*.aab" | Select-Object -First 1
117120 if ($aabFile) {
118- $targetPath = Join-Path $publishDir 'App.aab'
119- Copy-Item -Path $aabFile.FullName -Destination $targetPath -Force
120- Write-Host "AAB file copied to: $targetPath"
121-
122- # Debug the contents
123- Get-ChildItem -Recurse $publishDir
124-
125- if (Test-Path $targetPath) {
126- Write-Host "✓ AAB file ready for upload at: $targetPath"
127- Write-Host "File size: $((Get-Item $targetPath).Length) bytes"
128-
129- # Set environment variables with normalized paths for the action
130- $normalizedServiceAccount = "${{ github.workspace }}/service_account.json"
131- $normalizedAabPath = "${{ github.workspace }}/publish/App.aab"
132-
133- echo "SERVICE_ACCOUNT_PATH=$normalizedServiceAccount" >> $env:GITHUB_ENV
134- echo "AAB_FILE_PATH=$normalizedAabPath" >> $env:GITHUB_ENV
135-
136- Write-Host "Set SERVICE_ACCOUNT_PATH: $normalizedServiceAccount"
137- Write-Host "Set AAB_FILE_PATH: $normalizedAabPath"
138- } else {
139- Write-Error "Failed to copy AAB file"
140- exit 1
141- }
121+ Copy-Item -Path $aabFile.FullName -Destination "publish\App.aab" -Force
122+ Write-Host "AAB file copied to working directory: publish\App.aab"
142123 } else {
143124 Write-Error "No AAB file found in artifacts"
144125 exit 1
145126 }
146127
128+ # 🚨 CRITICAL FIX: Write service account to working directory
147129 - name : Write Service Account JSON
148130 shell : pwsh
149- run : echo "${{ secrets.GCP_CREDENTIALS }}" > "${{ github.workspace }}\ service_account.json"
131+ run : echo "${{ secrets.GCP_CREDENTIALS }}" > "service_account.json"
150132
133+ # 🚨 CRITICAL FIX: Verify files in working directory
151134 - name : Verify files before upload
152135 shell : pwsh
153136 run : |
154137 Write-Host "=== Final verification ==="
155- Write-Host "Service Account JSON exists: $(Test-Path '${{ github.workspace }}\service_account.json')"
156- Write-Host "AAB file exists: $(Test-Path '${{ github.workspace }}\publish\App.aab')"
157- Write-Host "Environment variables:"
158- Write-Host "SERVICE_ACCOUNT_PATH: $env:SERVICE_ACCOUNT_PATH"
159- Write-Host "AAB_FILE_PATH: $env:AAB_FILE_PATH"
138+ Write-Host "Working directory contents:"
139+ Get-ChildItem "." | Format-Table -AutoSize
140+ Write-Host "Service Account JSON exists: $(Test-Path 'service_account.json')"
141+ Write-Host "AAB file exists: $(Test-Path 'publish\App.aab')"
142+ if (Test-Path 'publish\App.aab') {
143+ Write-Host "AAB file size: $((Get-Item 'publish\App.aab').Length) bytes"
144+ }
160145
146+ # CRITICAL FIX: Use relative paths in the action
161147 - name : Deploy to Google Play Store (Beta)
162- uses : r0adkll/upload-google-play@v1.1.2
148+ uses : r0adkll/upload-google-play@v1.1.3 # try version 1.1.3
163149 with :
164- serviceAccountJson : ${{ env.SERVICE_ACCOUNT_PATH }}
150+ serviceAccountJson : service_account.json # CHANGED: Relative path
165151 packageName : com.icarda.feedapp
166- releaseFiles : ${{ env.AAB_FILE_PATH }}
152+ releaseFiles : publish/App.aab # CHANGED: Relative path with forward slash
167153 track : beta
168154 status : completed
169155
0 commit comments