Skip to content

Commit abcf043

Browse files
authored
Merge pull request #10 from henry-js/develop
update
2 parents c6c3ef8 + 40f1672 commit abcf043

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

.github/workflows/publish-release.yml

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ permissions:
99
contents: write
1010

1111
jobs:
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
@@ -60,11 +59,9 @@ jobs:
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:
@@ -83,10 +80,9 @@ jobs:
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+

public.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ PROJECT_TO_PACK=DotNetPathUtils
55
APP_NAME=sampleApp
66
COMPANY_NAME='henry-js'
77
ICON_PATH='.build/assets/icon.ico'
8-
NUGET_SOURCE_URL="https://nuget.homelab.lan/v3/index.json"
8+
NUGET_SOURCE_URL="https://api.nuget.org/v3/index.json"

0 commit comments

Comments
 (0)