@@ -9,7 +9,6 @@ permissions:
99 contents : write
1010
1111jobs :
12- # Job 1: Check the configuration and produce outputs for other jobs.
1312 check-config :
1413 name : Check Project Configuration
1514 runs-on : ubuntu-latest
6059 echo "is_library is ${IS_LIBRARY}"
6160 echo "is_app is ${IS_APP}"
6261
63- # Job 2: Publish NuGet package, if configured as a library.
6462 release-nuget :
6563 name : Publish NuGet Package
66- needs : check-config # This job depends on the check finishing first.
67- # This 'if' condition now correctly uses the 'needs' context.
64+ needs : check-config
6865 if : needs.check-config.outputs.is_library == 'true'
6966 runs-on : ubuntu-latest
7067 steps :
8380 - name : Pack and Push NuGet Package
8481 run : task push-nuget
8582
86- # Job 3: Prepare the Velopack release, if configured as an application.
8783 release-velopack :
8884 name : Prepare Velopack Release
89- needs : check-config # This job also depends on the check.
85+ needs : check-config
9086 if : needs.check-config.outputs.is_app == 'true'
9187 runs-on : ubuntu-latest
9288 outputs :
@@ -123,14 +119,44 @@ jobs:
123119 with :
124120 repo-token : ${{ secrets.GITHUB_TOKEN }}
125121 - name : Add .NET tools to PATH
126- if : runner.os != 'Windows' # This step is only needed on Linux and macOS
122+ if : runner.os != 'Windows'
127123 run : echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
128124 - name : Run Tests
129125 run : task test
130126 - name : Build and Pack for ${{ matrix.os }}-${{ matrix.arch }}
131127 run : task build-platform-release OS=${{ matrix.os }} ARCH=${{ matrix.arch }} APP_VERSION=${{ github.ref_name }}
132128 - name : Upload Artifacts
133- uses : actions/upload-artifact@v4
134- with :
135- name : release-assets-${{ matrix.os }}-${{ matrix.arch }}
136- path : dist/releases/
129+ env :
130+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131+ shell : bash
132+ run : |
133+ RID="${{ matrix.os }}-${{ matrix.arch }}"
134+ SEARCH_PATH="./dist/releases/$RID"
135+ echo "Searching for release asset in: $SEARCH_PATH"
136+
137+ # Use find to build a list of all files we want to upload.
138+ # The -o flag means "OR".
139+ if [[ "${{ matrix.os }}" == "win" ]]; then
140+ # For Windows, find the -Setup.exe AND the -Portable.zip
141+ FILES_TO_UPLOAD=$(find "$SEARCH_PATH" \( -name "*-Setup.exe" -o -name "*-Portable.zip" \))
142+ elif [[ "${{ matrix.os }}" == "linux" ]]; then
143+ # For Linux, find the .AppImage AND the -Portable.zip
144+ FILES_TO_UPLOAD=$(find "$SEARCH_PATH" \( -name "*.AppImage" -o -name "*-Portable.zip" \))
145+ elif [[ "${{ matrix.os }}" == "osx" ]]; then
146+ # For macOS, find ALL .zip files (which includes the main app and portable)
147+ FILES_TO_UPLOAD=$(find "$SEARCH_PATH" -name "*.zip")
148+ fi
149+
150+ # Check if we found any files before trying to upload.
151+ if [[ -z "$FILES_TO_UPLOAD" ]]; then
152+ echo "::error::Could not find any release assets to upload in $SEARCH_PATH"
153+ exit 1
154+ fi
155+
156+ echo "--- Found assets to upload ---"
157+ echo "$FILES_TO_UPLOAD"
158+ echo "------------------------------"
159+
160+ # Use xargs to pass the list of files to the gh command.
161+ echo "$FILES_TO_UPLOAD" | xargs gh release upload ${{ github.ref_name }} --clobber
162+
0 commit comments