-
Notifications
You must be signed in to change notification settings - Fork 1
Add velopack support #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b9255b3
Update action.yaml
Geenz 2f38cbb
Remove SLVersionChecker from signing.
Geenz 2c924e1
Update action.yaml
Geenz 19c1c1d
Make sure we mirror our Windows flow for macOS with velopack.
Geenz 0e9d9cc
Add setup-velopack action
Geenz 18d1163
Update action.yaml
Geenz 0392205
Update action.yaml
Geenz e50e1d8
Update action.yaml
Geenz a3e46cf
Update action.yaml
Geenz fec4749
Update action.yaml
Geenz acff8fd
Update action.yaml
Geenz 3730c7d
Update action.yaml
Geenz 703e65a
Update action.yaml
Geenz ddac424
Update action.yaml
Geenz ea7bdc3
Update action.yaml
Geenz edbf610
Update action.yaml
Geenz 866cc31
Update action.yaml
Geenz 96a132f
Update action.yaml
Geenz b914644
Update action.yaml
Geenz 22a17b6
Update action.yaml
Geenz 7249f5b
Split signing into two steps.
Geenz acb34c8
Update action.yaml
Geenz 5c4dabe
Velopack icon workaround
marchcat 2caafcf
Merge pull request #24 from secondlife/marchcat/vp-icon
Geenz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| name: setup-velopack | ||
| description: | ||
| Install the Velopack CLI (vpk) and replace the bundled Setup.exe | ||
| with the patched version from our 3p-velopack autobuild package | ||
| that tolerates unknown command-line arguments from legacy launchers. | ||
|
|
||
| inputs: | ||
| dotnet_version: | ||
| description: ".NET SDK version to install" | ||
| required: false | ||
| default: '9.0.x' | ||
| setup_exe_source: | ||
| description: > | ||
| Where to get the patched setup.exe (Windows only). Options: | ||
| 'auto' (default) - Download from latest 3p-velopack GitHub release | ||
| 'none' - Skip replacement, use upstream vpk's bundled setup.exe | ||
| A URL - Download from this specific URL | ||
| required: false | ||
| default: 'auto' | ||
| github_token: | ||
| description: > | ||
| GitHub token with access to secondlife-3p/3p-velopack releases. | ||
| Required when setup_exe_source is 'auto'. Falls back to github.token. | ||
| required: false | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: ${{ inputs.dotnet_version }} | ||
|
|
||
| - name: Install Velopack CLI | ||
| shell: bash | ||
| run: dotnet tool install -g vpk --prerelease | ||
|
|
||
| - name: Replace bundled Setup.exe with patched version | ||
| if: ${{ runner.os == 'Windows' && inputs.setup_exe_source != 'none' }} | ||
| shell: bash | ||
| env: | ||
| SETUP_EXE_SOURCE: ${{ inputs.setup_exe_source }} | ||
| GH_TOKEN: ${{ inputs.github_token || github.token }} | ||
| run: | | ||
| set -e | ||
|
|
||
| # Find the vpk tool store — try both Unix and Windows-style home paths | ||
| VPK_STORE="" | ||
| for candidate in \ | ||
| "$HOME/.dotnet/tools/.store/vpk" \ | ||
| "$USERPROFILE/.dotnet/tools/.store/vpk" \ | ||
| "$(cygpath "$USERPROFILE" 2>/dev/null)/.dotnet/tools/.store/vpk" | ||
| do | ||
| if [[ -d "$candidate" ]]; then | ||
| VPK_STORE="$candidate" | ||
| break | ||
| fi | ||
| done | ||
|
|
||
| if [[ -z "$VPK_STORE" ]]; then | ||
| echo "::error::vpk tool store not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Find setup.exe in the store | ||
| BUNDLED_SETUP="$(find "$VPK_STORE" -iname 'setup.exe' -type f | head -n 1)" | ||
| if [[ -z "$BUNDLED_SETUP" ]]; then | ||
| echo "::error::Could not find setup.exe in vpk tool store at $VPK_STORE" | ||
| find "$VPK_STORE" -type f | head -20 | ||
| exit 1 | ||
| fi | ||
| echo "Found bundled setup.exe at: $BUNDLED_SETUP" | ||
|
|
||
| if [[ "$SETUP_EXE_SOURCE" == "auto" ]]; then | ||
| # Fetch the latest release from 3p-velopack and find the windows64 asset | ||
| echo "Fetching latest 3p-velopack release..." | ||
| RELEASE_JSON="$(curl -sf \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer $GH_TOKEN" \ | ||
| "https://api.github.com/repos/secondlife-3p/3p-velopack/releases/latest")" | ||
|
|
||
| if [[ -z "$RELEASE_JSON" ]]; then | ||
| echo "::warning::Could not fetch 3p-velopack releases, skipping setup.exe replacement" | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Find the windows64 asset API URL (use 'url' not 'browser_download_url' for auth) | ||
| ASSET_URL="$(echo "$RELEASE_JSON" | python3 -c " | ||
| import json, sys | ||
| data = json.load(sys.stdin) | ||
| for asset in data.get('assets', []): | ||
| if 'windows64' in asset['name']: | ||
| print(asset['url']) | ||
| break | ||
| ")" | ||
|
|
||
| if [[ -z "$ASSET_URL" ]]; then | ||
| echo "::warning::No windows64 asset found in latest 3p-velopack release, skipping setup.exe replacement" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Downloading 3p-velopack windows64 package..." | ||
| dl_tmpdir="$(mktemp -d)" | ||
| dl_archive="$dl_tmpdir/velopack-pkg" | ||
| curl -L -f -o "$dl_archive" \ | ||
| -H "Accept: application/octet-stream" \ | ||
| -H "Authorization: Bearer $GH_TOKEN" \ | ||
| "$ASSET_URL" | ||
|
|
||
| # Extract bin/setup.exe from the archive. | ||
| # Autobuild packages are .tar.zst — vpk ships zstd.exe in its vendor dir. | ||
| ZSTD="$(find "$VPK_STORE" -name 'zstd.exe' -type f | head -n 1)" | ||
| if [[ -n "$ZSTD" ]]; then | ||
| echo "Using zstd from vpk: $ZSTD" | ||
| "$ZSTD" -d -f "$dl_archive" -o "$dl_tmpdir/velopack.tar" | ||
| tar xf "$dl_tmpdir/velopack.tar" -C "$dl_tmpdir" "bin/setup.exe" 2>&1 || true | ||
| else | ||
| echo "No zstd found, trying tar directly..." | ||
| tar xf "$dl_archive" -C "$dl_tmpdir" "bin/setup.exe" 2>&1 || true | ||
| fi | ||
|
|
||
| if [[ -f "$dl_tmpdir/bin/setup.exe" ]]; then | ||
| cp "$dl_tmpdir/bin/setup.exe" "$BUNDLED_SETUP" | ||
| echo "Replaced setup.exe from 3p-velopack package" | ||
| else | ||
| echo "::warning::bin/setup.exe not found in 3p-velopack package, skipping replacement" | ||
| fi | ||
| rm -rf "$dl_tmpdir" | ||
| else | ||
| # Direct URL provided | ||
| echo "Downloading patched setup.exe from: $SETUP_EXE_SOURCE" | ||
| curl -L -f -o "$BUNDLED_SETUP" "$SETUP_EXE_SOURCE" | ||
| echo "Replaced setup.exe from URL" | ||
| fi | ||
|
|
||
| ls -la "$BUNDLED_SETUP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.