@@ -93,15 +93,19 @@ jobs:
9393 os : macos-latest
9494 - type : Android
9595 android : apk
96+ binaryPath : gallery/build/outputs/apk/release/
9697 os : ubuntu-latest
9798 - type : Windows
9899 desktop : msi
100+ binaryPath : gallery/build/compose/binaries/
99101 os : windows-latest
100102 - type : Linux
101103 desktop : deb
104+ binaryPath : gallery/build/compose/binaries/
102105 os : ubuntu-latest
103106 - type : macOS
104107 desktop : dmg
108+ binaryPath : gallery/build/compose/binaries/
105109 os : macos-latest
106110
107111 runs-on : ${{ matrix.os }}
@@ -112,7 +116,7 @@ jobs:
112116 - uses : actions/checkout@v4
113117 with :
114118 fetch-depth : 0
115- ref : ${{ github.ref }}
119+ ref : ${{ needs.prepare-release.outputs.tag_name }}
116120 - name : Set up JDK 17
117121 uses : actions/setup-java@v4
118122 with :
@@ -157,30 +161,6 @@ jobs:
157161 ANDROID_SIGNING_KEY_ALIAS : ${{ secrets.KEY_ALIAS }}
158162 ANDROID_SIGNING_KEY_PASSWORD : ${{ secrets.KEY_PASSWORD }}
159163
160- # Step 4: Find the build artifact
161- # This new step searches the build directory for a file with the specified suffix.
162- - name : Find Android Build Artifact
163- id : find_android_artifact
164- if : ${{ matrix.android }}
165- # Use PowerShell for cross-platform compatibility (available on all runners)
166- shell : pwsh
167- run : |
168- $searchPath = "${{ github.workspace }}/gallery/build/outputs/apk/release/"
169- $artifact = Get-ChildItem -Path $searchPath -Filter "*${{ matrix.android }}" -Recurse | Where-Object { !$_.PSIsContainer }
170- if ($artifact.Count -ne 1) {
171- Write-Error "Error: Expected 1 artifact, but found $($artifact.Count)."
172- exit 1
173- }
174-
175- $asset_path = $artifact.FullName
176- $asset_name = $artifact.Name
177-
178- Write-Host "Found artifact path: $asset_path"
179- Write-Host "Final asset name: $asset_name"
180-
181- echo "asset_path=$asset_path" | Add-Content -Path $env:GITHUB_OUTPUT
182- echo "asset_name=$asset_name" | Add-Content -Path $env:GITHUB_OUTPUT
183-
184164 # Desktop Build Action
185165 - name : Build Gallery for ${{ matrix.type }}
186166 if : ${{ matrix.desktop }}
@@ -189,14 +169,14 @@ jobs:
189169
190170 # Step 4: Find the build artifact
191171 # This new step searches the build directory for a file with the specified suffix.
192- - name : Find Desktop Build Artifact
172+ - name : Find Build Artifact
193173 id : find_artifact
194- if : ${{ matrix.desktop }}
174+ if : ${{ matrix.binaryPath }}
195175 # Use PowerShell for cross-platform compatibility (available on all runners)
196176 shell : pwsh
197177 run : |
198- $searchPath = "${{ github.workspace }}/gallery/build/compose/binaries/ "
199- $artifact = Get-ChildItem -Path $searchPath -Filter "*${{ matrix.desktop }}" -Recurse | Where-Object { !$_.PSIsContainer }
178+ $searchPath = "${{ github.workspace }}/${{ matrix.binaryPath }} "
179+ $artifact = Get-ChildItem -Path $searchPath -Filter "*${{ matrix.desktop != '' && matrix.desktop || matrix.android }}" -Recurse | Where-Object { !$_.PSIsContainer }
200180 if ($artifact.Count -ne 1) {
201181 Write-Error "Error: Expected 1 artifact, but found $($artifact.Count)."
202182 exit 1
0 commit comments