Skip to content

Commit b6df576

Browse files
committed
Fix windows velopack package creation in GHA
1 parent 3725517 commit b6df576

5 files changed

Lines changed: 146 additions & 106 deletions

File tree

.github/workflows/build.yaml

Lines changed: 132 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- name: Setup python
5757
uses: actions/setup-python@v6
5858
with:
59-
python-version: "3.13"
59+
python-version: "3.14"
6060

6161
- name: Determine source branch
6262
id: which-branch
@@ -254,14 +254,6 @@ jobs:
254254
- name: Install python dependencies
255255
run: pip3 install llsd cmake ninja
256256

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-
265257
- name: Bootstrap vcpkg Windows
266258
if: runner.os == 'Windows'
267259
run: |
@@ -472,34 +464,102 @@ jobs:
472464
# ${{ steps.configure.outputs.build_directory }}/llappearanceutility/Release/appearance-utility-bin
473465
# ${{ steps.configure.outputs.build_directory }}/llappearanceutility/Release/appearance-utility-headless-bin
474466

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 }}"
467+
sign-and-package-windows:
468+
needs: [setup, build]
469+
runs-on: windows-2025
470+
steps:
471+
- name: Setup .NET for Velopack
472+
uses: actions/setup-dotnet@v5
473+
with:
474+
dotnet-version: '10.x'
475+
476+
- name: Install Velopack CLI
477+
run: dotnet tool restore
478+
479+
- name: Fetch Windows app
480+
uses: actions/download-artifact@v8
481+
with:
482+
name: Windows-app
483+
path: .app
484+
485+
- name: Build and sign Velopack package
486+
shell: bash
487+
env:
488+
PACK_ID: ${{ needs.build.outputs.velopack_pack_id }}
489+
PACK_VERSION: ${{ needs.build.outputs.velopack_pack_version }}
490+
PACK_TITLE: ${{ needs.build.outputs.velopack_pack_title }}
491+
PACK_AUTHORS: ${{ needs.build.outputs.velopack_pack_authors }}
492+
MAIN_EXE: ${{ needs.build.outputs.velopack_main_exe }}
493+
EXCLUDE: ${{ needs.build.outputs.velopack_exclude }}
494+
ICON: ${{ needs.build.outputs.velopack_icon }}
495+
SPLASH_IMAGE: ${{ needs.build.outputs.velopack_splash }}
496+
SPLASH_COLOR: ${{ needs.build.outputs.velopack_splash_color }}
497+
INSTALLER_BASE: ${{ needs.build.outputs.velopack_installer_base }}
498+
run: |
499+
set -x
500+
501+
vpk_args=(
502+
vpk pack
503+
--packId "$PACK_ID"
504+
--packVersion "$PACK_VERSION"
505+
--packAuthors "$PACK_AUTHORS"
506+
--packDir .app
507+
--mainExe "$MAIN_EXE"
508+
--packTitle "$PACK_TITLE"
509+
--exclude "$EXCLUDE"
510+
--shortcuts ''
511+
--splashProgressColor "$SPLASH_COLOR"
512+
)
513+
514+
# Add icon if provided
515+
if [[ -n "$ICON" && -f ".app/$ICON" ]]; then
516+
vpk_args+=(--icon ".app/$ICON")
517+
fi
518+
519+
# Add splash if provided
520+
if [[ -n "$SPLASH_IMAGE" && -f ".app/$SPLASH_IMAGE" ]]; then
521+
vpk_args+=(--splashImage ".app/$SPLASH_IMAGE")
522+
fi
523+
524+
"${vpk_args[@]}"
525+
526+
- name: Rename Velopack outputs
527+
shell: bash
528+
env:
529+
PACK_ID: ${{ inputs.velopack_pack_id }}
530+
INSTALLER_BASE: ${{ inputs.velopack_installer_base }}
531+
run: |
532+
# Move Setup.exe into .app for the installer upload step
533+
setup="Releases/${PACK_ID}-win-Setup.exe"
534+
if [[ -f "$setup" ]]; then
535+
mv "$setup" ".app/${INSTALLER_BASE}_Setup.exe"
536+
echo "Moved $setup to .app/${INSTALLER_BASE}_Setup.exe"
537+
fi
538+
539+
# Rename Portable.zip to include version
540+
portable="Releases/${PACK_ID}-win-Portable.zip"
541+
if [[ -f "$portable" ]]; then
542+
mv "$portable" "Releases/${INSTALLER_BASE}_Portable.zip"
543+
echo "Moved $portable to Releases/${INSTALLER_BASE}_Portable.zip"
544+
fi
545+
546+
- name: Find Velopack installer
547+
shell: bash
548+
run: |
549+
installer="$(ls -t .app/*_Setup.exe | head -n 1)"
550+
echo "installer=$installer" >> "$GITHUB_ENV"
551+
552+
- name: Post the installer
553+
uses: actions/upload-artifact@v7
554+
with:
555+
name: "Windows-installer"
556+
path: ${{ env.installer }}
557+
558+
- name: Upload Velopack releases
559+
uses: actions/upload-artifact@v7
560+
with:
561+
name: "Windows-releases"
562+
path: Releases/
503563

504564
# sign-and-package-mac:
505565
# env:
@@ -610,60 +670,41 @@ jobs:
610670
# node-version: "22"
611671
# dumpSyms: false
612672

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"
673+
release:
674+
needs: [setup, build, sign-and-package-windows, sign-and-package-mac]
675+
runs-on: ubuntu-latest
676+
if: needs.setup.outputs.release_run
677+
steps:
678+
- uses: actions/download-artifact@v8
679+
with:
680+
pattern: "*-installer"
625681

626-
# - uses: actions/download-artifact@v8
627-
# with:
628-
# pattern: "*-releases"
682+
- uses: actions/download-artifact@v8
683+
with:
684+
pattern: "*-releases"
629685

630-
# - uses: actions/download-artifact@v8
631-
# with:
632-
# name: "Linux-app"
686+
- uses: actions/download-artifact@v8
687+
with:
688+
name: "Linux-app"
633689

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 }}"
690+
# forked from softprops/action-gh-release
691+
- name: Create GitHub release
692+
id: release
693+
uses: AlchemyViewer/action-gh-release@v3
694+
with:
695+
# name the release page for the branch. We want channel and version.
696+
name: "${{ needs.build.outputs.viewer_channel }} ${{ needs.build.outputs.viewer_version }}"
697+
body: |
698+
prerelease: true
699+
generate_release_notes: true
700+
target_commitish: ${{ github.sha }}
701+
append_body: true
702+
fail_on_unmatched_files: true
703+
files: |
704+
Windows-installer/*.exe
705+
*.tar.xz
706+
Windows-releases/*
707+
708+
- name: post release URL
709+
run: |
710+
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

indra/vcpkg/ports/velopack/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "velopack",
3-
"version-string": "1.1.1",
3+
"version-string": "1.2.0",
44
"description": "Installer and automatic update framework for cross-platform desktop applications",
55
"homepage": "https://velopack.io/",
66
"license": "MIT"

0 commit comments

Comments
 (0)