Skip to content

Commit 3be369a

Browse files
authored
Merge pull request #333 from AlchemyViewer/rye/gha-fixes
Fix windows velopack package creation in GHA
2 parents c7cd3b1 + 90cdc3e commit 3be369a

5 files changed

Lines changed: 177 additions & 107 deletions

File tree

.github/workflows/build.yaml

Lines changed: 163 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
branches: ["main", "release/*", "beta/*", "project/*"]
2727
tags: ["Alchemy*"]
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
# The whole point of the setup job is that we want to set variables once
3134
# that will be consumed by multiple subsequent jobs.
@@ -56,7 +59,7 @@ jobs:
5659
- name: Setup python
5760
uses: actions/setup-python@v6
5861
with:
59-
python-version: "3.13"
62+
python-version: "3.14"
6063

6164
- name: Determine source branch
6265
id: which-branch
@@ -138,7 +141,7 @@ jobs:
138141
runner: ["windows-2025-vs2026", "macos-26", "ubuntu-24.04"]
139142
configuration: [release]
140143
arch: [x64, arm64]
141-
build_variant: [Viewer, Tests]
144+
build_variant: [Viewer]
142145
exclude:
143146
- runner: ubuntu-24.04
144147
arch: arm64
@@ -160,10 +163,13 @@ jobs:
160163
# Windows Velopack outputs (passed to sign-pkg-windows)
161164
velopack_pack_id: ${{ steps.build.outputs.velopack_pack_id }}
162165
velopack_pack_version: ${{ steps.build.outputs.velopack_pack_version }}
166+
velopack_pack_authors: ${{ steps.build.outputs.velopack_pack_authors }}
163167
velopack_pack_title: ${{ steps.build.outputs.velopack_pack_title }}
164168
velopack_main_exe: ${{ steps.build.outputs.velopack_main_exe }}
165169
velopack_exclude: ${{ steps.build.outputs.velopack_exclude }}
166170
velopack_icon: ${{ steps.build.outputs.velopack_icon }}
171+
velopack_splash: ${{ steps.build.outputs.velopack_splash }}
172+
velopack_splash_color: ${{ steps.build.outputs.velopack_splash_color }}
167173
velopack_installer_base: ${{ steps.build.outputs.velopack_installer_base }}
168174
# macOS Velopack outputs (passed to sign-pkg-mac)
169175
velopack_mac_pack_id: ${{ steps.build.outputs.velopack_mac_pack_id }}
@@ -254,14 +260,6 @@ jobs:
254260
- name: Install python dependencies
255261
run: pip3 install llsd cmake ninja
256262

257-
- name: Setup .NET for Velopack
258-
uses: actions/setup-dotnet@v5
259-
with:
260-
dotnet-version: '10.x'
261-
262-
- name: Install Velopack CLI
263-
run: dotnet tool restore
264-
265263
- name: Bootstrap vcpkg Windows
266264
if: runner.os == 'Windows'
267265
run: |
@@ -472,34 +470,124 @@ jobs:
472470
# ${{ steps.configure.outputs.build_directory }}/llappearanceutility/Release/appearance-utility-bin
473471
# ${{ steps.configure.outputs.build_directory }}/llappearanceutility/Release/appearance-utility-headless-bin
474472

475-
# sign-and-package-windows:
476-
# env:
477-
# AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }}
478-
# AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }}
479-
# AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
480-
# AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
481-
# AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
482-
# needs: [setup, build]
483-
# runs-on: windows-2022
484-
# if: needs.setup.outputs.build_type == 'proprietary'
485-
# steps:
486-
# - name: Sign and package Windows viewer
487-
# if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID
488-
# uses: secondlife/viewer-build-util/sign-pkg-windows@geenz/velopack
489-
# with:
490-
# vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}"
491-
# cert_name: "${{ env.AZURE_CERT_NAME }}"
492-
# client_id: "${{ env.AZURE_CLIENT_ID }}"
493-
# client_secret: "${{ env.AZURE_CLIENT_SECRET }}"
494-
# tenant_id: "${{ env.AZURE_TENANT_ID }}"
495-
# installer_type: "${{ github.event.inputs.installer_type || 'velopack' }}"
496-
# velopack_pack_id: "${{ needs.build.outputs.velopack_pack_id }}"
497-
# velopack_pack_version: "${{ needs.build.outputs.velopack_pack_version }}"
498-
# velopack_pack_title: "${{ needs.build.outputs.velopack_pack_title }}"
499-
# velopack_main_exe: "${{ needs.build.outputs.velopack_main_exe }}"
500-
# velopack_exclude: "${{ needs.build.outputs.velopack_exclude }}"
501-
# velopack_icon: "${{ needs.build.outputs.velopack_icon }}"
502-
# velopack_installer_base: "${{ needs.build.outputs.velopack_installer_base }}"
473+
sign-and-package-windows:
474+
needs: [setup, build]
475+
runs-on: windows-2025
476+
steps:
477+
- name: Checkout code
478+
uses: actions/checkout@v7
479+
with:
480+
persist-credentials: false
481+
submodules: recursive
482+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
483+
484+
- name: Setup .NET for Velopack
485+
uses: actions/setup-dotnet@v5
486+
with:
487+
dotnet-version: '10.x'
488+
489+
- name: Install Velopack CLI
490+
run: dotnet tool restore
491+
492+
- name: Fetch Windows app
493+
uses: actions/download-artifact@v8
494+
if: needs.setup.outputs.build_type == 'proprietary'
495+
with:
496+
name: Windows-x64-app
497+
path: .app
498+
499+
- name: Fetch Windows OS app
500+
uses: actions/download-artifact@v8
501+
if: needs.setup.outputs.build_type != 'proprietary'
502+
with:
503+
name: Windows-OS-x64-app
504+
path: .app
505+
506+
- name: Build and sign Velopack package
507+
shell: bash
508+
env:
509+
PACK_ID: ${{ needs.build.outputs.velopack_pack_id }}
510+
PACK_VERSION: ${{ needs.build.outputs.velopack_pack_version }}
511+
PACK_TITLE: ${{ needs.build.outputs.velopack_pack_title }}
512+
PACK_AUTHORS: ${{ needs.build.outputs.velopack_pack_authors }}
513+
MAIN_EXE: ${{ needs.build.outputs.velopack_main_exe }}
514+
EXCLUDE: ${{ needs.build.outputs.velopack_exclude }}
515+
ICON: ${{ needs.build.outputs.velopack_icon }}
516+
SPLASH_IMAGE: ${{ needs.build.outputs.velopack_splash }}
517+
SPLASH_COLOR: ${{ needs.build.outputs.velopack_splash_color }}
518+
INSTALLER_BASE: ${{ needs.build.outputs.velopack_installer_base }}
519+
run: |
520+
set -x
521+
522+
vpk_args=(
523+
dotnet vpk pack
524+
--packId "$PACK_ID"
525+
--packVersion "$PACK_VERSION"
526+
--packAuthors "$PACK_AUTHORS"
527+
--packDir .app
528+
--mainExe "$MAIN_EXE"
529+
--packTitle "$PACK_TITLE"
530+
--exclude "$EXCLUDE"
531+
--shortcuts ''
532+
--splashProgressColor "$SPLASH_COLOR"
533+
)
534+
535+
# Add icon if provided
536+
if [[ -n "$ICON" && -f ".app/$ICON" ]]; then
537+
vpk_args+=(--icon ".app/$ICON")
538+
fi
539+
540+
# Add splash if provided
541+
if [[ -n "$SPLASH_IMAGE" && -f ".app/$SPLASH_IMAGE" ]]; then
542+
vpk_args+=(--splashImage ".app/$SPLASH_IMAGE")
543+
fi
544+
545+
"${vpk_args[@]}"
546+
547+
- name: Rename Velopack outputs
548+
shell: bash
549+
env:
550+
PACK_ID: ${{ needs.build.outputs.velopack_pack_id }}
551+
INSTALLER_BASE: ${{ needs.build.outputs.velopack_installer_base }}
552+
run: |
553+
# Move Setup.exe into .app for the installer upload step
554+
setup="Releases/${PACK_ID}-win-Setup.exe"
555+
if [[ -f "$setup" ]]; then
556+
mv "$setup" ".app/${INSTALLER_BASE}_Setup.exe"
557+
echo "Moved $setup to .app/${INSTALLER_BASE}_Setup.exe"
558+
fi
559+
560+
# Rename Portable.zip to include version
561+
portable="Releases/${PACK_ID}-win-Portable.zip"
562+
if [[ -f "$portable" ]]; then
563+
mv "$portable" "Releases/${INSTALLER_BASE}_Portable.zip"
564+
echo "Moved $portable to Releases/${INSTALLER_BASE}_Portable.zip"
565+
fi
566+
567+
- name: Find Velopack installer
568+
id: find-installer
569+
shell: bash
570+
run: |
571+
installer="$(ls -t .app/*_Setup.exe 2>/dev/null | head -n 1 || true)"
572+
if [[ -z "$installer" ]]; then
573+
echo "::error::No Velopack installer found under .app"
574+
exit 1
575+
fi
576+
echo "installer=$installer" >> "$GITHUB_OUTPUT"
577+
578+
- name: Post the installer
579+
uses: actions/upload-artifact@v7
580+
with:
581+
name: "Windows-installer"
582+
path: ${{ steps.find-installer.outputs.installer }}
583+
if-no-files-found: error
584+
585+
- name: Upload Velopack releases
586+
uses: actions/upload-artifact@v7
587+
with:
588+
name: "Windows-releases"
589+
path: Releases/
590+
if-no-files-found: error
503591

504592
# sign-and-package-mac:
505593
# env:
@@ -610,60 +698,43 @@ jobs:
610698
# node-version: "22"
611699
# dumpSyms: false
612700

613-
# release:
614-
# needs: [setup, build, sign-and-package-windows, sign-and-package-mac]
615-
# runs-on: ubuntu-latest
616-
# if: needs.setup.outputs.release_run
617-
# steps:
618-
# # - uses: actions/download-artifact@v8
619-
# # with:
620-
# # pattern: "*-installer"
621-
622-
# - uses: actions/download-artifact@v8
623-
# with:
624-
# pattern: "*-metadata"
701+
release:
702+
needs: [setup, build, sign-and-package-windows]
703+
runs-on: ubuntu-latest
704+
if: needs.setup.outputs.release_run
705+
permissions:
706+
contents: write
707+
steps:
708+
- uses: actions/download-artifact@v8
709+
with:
710+
pattern: "*-installer"
625711

626-
# - uses: actions/download-artifact@v8
627-
# with:
628-
# pattern: "*-releases"
712+
- uses: actions/download-artifact@v8
713+
with:
714+
pattern: "*-releases"
629715

630-
# - uses: actions/download-artifact@v8
631-
# with:
632-
# name: "Linux-app"
716+
- uses: actions/download-artifact@v8
717+
with:
718+
name: "Linux-x64-app"
633719

634-
# - name: Rename metadata
635-
# run: |
636-
# cp Windows-metadata/newview/viewer_version.txt Windows-viewer_version.txt
637-
# cp macOS-metadata/newview/viewer_version.txt macOS-viewer_version.txt
638-
# cp Linux-metadata/newview/viewer_version.txt Linux-viewer_version.txt
639-
640-
# # forked from softprops/action-gh-release
641-
# - name: Create GitHub release
642-
# id: release
643-
# uses: AlchemyViewer/action-gh-release@v2
644-
# with:
645-
# # name the release page for the branch
646-
# name: "${{ needs.setup.outputs.viewer_branch }}"
647-
# # SL-20546: want the channel and version to be visible on the
648-
# # release page
649-
# body: |
650-
# Build ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
651-
# ${{ needs.setup.outputs.viewer_channel }}
652-
# ${{ needs.build.outputs.viewer_version }}
653-
# ${{ needs.setup.outputs.relnotes }}
654-
# prerelease: true
655-
# generate_release_notes: true
656-
# target_commitish: ${{ github.sha }}
657-
# append_body: true
658-
# fail_on_unmatched_files: true
659-
# files: |
660-
# macOS-installer/*.dmg
661-
# Windows-installer/*.exe
662-
# *.tar.xz
663-
# *-viewer_version.txt
664-
# Windows-releases/*
665-
# macOS-releases/*
666-
667-
# - name: post release URL
668-
# run: |
669-
# echo "::notice::Release ${{ steps.release.outputs.url }}"
720+
# forked from softprops/action-gh-release
721+
- name: Create GitHub release
722+
id: release
723+
uses: AlchemyViewer/action-gh-release@v3
724+
with:
725+
# name the release page for the branch. We want channel and version.
726+
name: "${{ needs.setup.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }}"
727+
body: |
728+
prerelease: true
729+
generate_release_notes: true
730+
target_commitish: ${{ github.sha }}
731+
append_body: true
732+
fail_on_unmatched_files: true
733+
files: |
734+
Windows-installer/*.exe
735+
*.tar.xz
736+
Windows-releases/*
737+
738+
- name: post release URL
739+
run: |
740+
echo "::notice::Release ${{ steps.release.outputs.url }}"

dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"vpk": {
6-
"version": "1.1.1",
6+
"version": "1.2.0",
77
"commands": [
88
"vpk"
99
],

indra/newview/viewer_manifest.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,6 @@ def installer_base_name(self):
270270
}
271271
return "%(channel_vendor_base)s%(channel_variant_underscores)s_%(version_underscores)s_%(arch)s" % substitution_strings
272272

273-
def installer_base_name_mac(self):
274-
global CHANNEL_VENDOR_BASE
275-
# a standard map of strings for replacing in the templates
276-
substitution_strings = {
277-
'channel_vendor_base' : '_'.join(CHANNEL_VENDOR_BASE.split()),
278-
'channel_variant_underscores':self.channel_variant_app_suffix(),
279-
'version_underscores' : '_'.join(self.args['version'])
280-
}
281-
return "%(channel_vendor_base)s%(channel_variant_underscores)s_%(version_underscores)s_universal" % substitution_strings
282-
283273
def app_name(self):
284274
global CHANNEL_VENDOR_BASE
285275
channel_type=self.channel_type()
@@ -554,6 +544,12 @@ def package_finish(self):
554544
if self.args.get('velopack', 'OFF').upper() != 'ON' and self.args.get('velopack', 'OFF').upper() != 'TRUE' and self.args.get('velopack', 'OFF').upper() != '1':
555545
return
556546

547+
# Velopack packaging author metadata. This is the "Authors" field in the Velopack installer.
548+
pack_authors = 'Alchemy Viewer Project'
549+
550+
# Velopack splash progress bar color
551+
splash_color = '#00a5dc'
552+
557553
# packId determines install folder: %LocalAppData%\{packId}
558554
# Uses same naming as NSIS INSTNAME for channel separation
559555
pack_id = self.app_name_oneword() # "SecondLife", "SecondLifeBeta", etc.
@@ -600,9 +596,11 @@ def package_finish(self):
600596
self.set_github_output('velopack_pack_id', pack_id)
601597
self.set_github_output('velopack_pack_version', pack_version)
602598
self.set_github_output('velopack_pack_title', pack_title)
599+
self.set_github_output('velopack_pack_authors', pack_authors)
603600
self.set_github_output('velopack_main_exe', main_exe)
604601
self.set_github_output('velopack_icon', icon_filename)
605602
self.set_github_output('velopack_splash', splash_filename)
603+
self.set_github_output('velopack_splash_color', splash_color)
606604
self.set_github_output('velopack_installer_base', installer_base)
607605
self.set_github_output('velopack_exclude', exclude_pattern)
608606
# Set package_file so llmanifest's touched.bat logic doesn't crash
@@ -615,6 +613,7 @@ def package_finish(self):
615613
'dotnet', 'vpk', 'pack',
616614
'--packId', pack_id,
617615
'--packVersion', pack_version,
616+
'--packAuthors', pack_authors,
618617
'--packDir', pack_dir,
619618
'--mainExe', main_exe,
620619
'--packTitle', pack_title,
@@ -624,7 +623,7 @@ def package_finish(self):
624623
'--shortcuts', '',
625624
'--outputDir', os.path.join(self.args['build'], 'Releases'),
626625
'--splashImage', splash_path,
627-
'--splashProgressColor', '#00a5dc',
626+
'--splashProgressColor', splash_color,
628627
]
629628

630629
# Add icon — CMake copies the channel-appropriate secondlife.ico to res/ll_icon.ico
@@ -859,7 +858,7 @@ def path_optional(src, dst):
859858
self.package_file = "copied_deps"
860859

861860
def package_finish(self):
862-
imagename = self.installer_base_name_mac()
861+
imagename = self.installer_base_name()
863862
self.set_github_output('imagename', imagename)
864863
finalname = imagename + ".dmg"
865864
self.package_file = finalname

indra/vcpkg/ports/velopack/portfile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO velopack/velopack
44
REF ${VERSION}
5-
SHA512 c12703a623555adc56c0e8f7ea70e789caa616d2d6f2c5a53eda7bf55794feee125b6a97817e17114ccf19ca1b43d377f70b5f417b7c9d2befa9f381c57f9d53
5+
SHA512 5f782dcc2a172a90dd3e13130e00e6a2144cb679061cc6e7512029f5fb197a3278a9d5db00f3819ac5cbaa078211c18cee5cc2b0c24bbb8d77bda1825382c002
66
HEAD_REF main
77
)
88

0 commit comments

Comments
 (0)