@@ -72,13 +72,13 @@ jobs:
7272
7373 - name : Debug - List publish directory
7474 shell : pwsh
75- run : Get-ChildItem -Recurse "${{ github.workspace }}/ publish"
75+ run : Get-ChildItem -Recurse "${{ github.workspace }}\ publish"
7676
7777 - name : Upload Android Build Artifact
7878 uses : actions/upload-artifact@v4
7979 with :
8080 name : Android-AAB
81- path : ${{ github.workspace }}/ publish/ App.aab
81+ path : ${{ github.workspace }}\ publish\ App.aab # Changed to backslashes
8282 overwrite : true
8383
8484 deploy-android :
@@ -90,18 +90,17 @@ jobs:
9090 - name : Download Android AAB
9191 uses : actions/download-artifact@v4
9292 with :
93- pattern : Android-AAB
94- path : ${{ github.workspace }}/artifacts
95- merge-multiple : true
93+ name : Android-AAB # Changed from pattern to name
94+ path : ${{ github.workspace }}\artifacts
9695
9796 - name : Debug - List downloaded files
9897 shell : pwsh
9998 run : |
10099 Write-Host "=== Artifacts directory structure ==="
101- Get-ChildItem -Recurse "${{ github.workspace }}/ artifacts" | Select-Object FullName
100+ Get-ChildItem -Recurse "${{ github.workspace }}\ artifacts" | Select-Object FullName
102101
103102 Write-Host "=== Looking for AAB files ==="
104- $aabFiles = Get-ChildItem -Recurse "${{ github.workspace }}/ artifacts" -Filter "*.aab"
103+ $aabFiles = Get-ChildItem -Recurse "${{ github.workspace }}\ artifacts" -Filter "*.aab"
105104 if ($aabFiles) {
106105 $aabFiles | ForEach-Object { Write-Host "Found: $($_.FullName)" }
107106 } else {
@@ -113,16 +112,29 @@ jobs:
113112 run : |
114113 $publishDir = Join-Path "${{ github.workspace }}" 'publish'
115114 if (!(Test-Path $publishDir)) { New-Item -ItemType Directory -Path $publishDir | Out-Null }
115+
116116 $aabFile = Get-ChildItem -Recurse "${{ github.workspace }}\artifacts" -Filter "*.aab" | Select-Object -First 1
117117 if ($aabFile) {
118118 $targetPath = Join-Path $publishDir 'App.aab'
119119 Copy-Item -Path $aabFile.FullName -Destination $targetPath -Force
120120 Write-Host "AAB file copied to: $targetPath"
121+
121122 # Debug the contents
122123 Get-ChildItem -Recurse $publishDir
124+
123125 if (Test-Path $targetPath) {
124126 Write-Host "✓ AAB file ready for upload at: $targetPath"
125127 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"
126138 } else {
127139 Write-Error "Failed to copy AAB file"
128140 exit 1
@@ -134,14 +146,24 @@ jobs:
134146
135147 - name : Write Service Account JSON
136148 shell : pwsh
137- run : echo "${{ secrets.GCP_CREDENTIALS }}" > ${{ github.workspace }}/service_account.json
149+ run : echo "${{ secrets.GCP_CREDENTIALS }}" > "${{ github.workspace }}\service_account.json"
150+
151+ - name : Verify files before upload
152+ shell : pwsh
153+ run : |
154+ 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"
138160
139161 - name : Deploy to Google Play Store (Beta)
140162 uses : r0adkll/upload-google-play@v1.1.2
141163 with :
142- serviceAccountJson : ${{ github.workspace }}/service_account.json
164+ serviceAccountJson : ${{ env.SERVICE_ACCOUNT_PATH }}
143165 packageName : com.icarda.feedapp
144- releaseFiles : ${{ github.workspace }}/publish/App.aab
166+ releaseFiles : ${{ env.AAB_FILE_PATH }}
145167 track : beta
146168 status : completed
147169
0 commit comments