Skip to content

Commit

Permalink
chore: use proper title in wails and add version to artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Sep 27, 2024
1 parent 46e76d9 commit 3b88e18
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Download Linux server archives
- name: Download server archives
uses: actions/download-artifact@v4
with:
pattern: albyhub-Server-*
pattern: AlbyHub-Server-*
path: artifacts
merge-multiple: true

- name: Download desktop archives
uses: actions/download-artifact@v4
with:
pattern: albyhub-Desktop-*
pattern: AlbyHub-Desktop-*
path: artifacts
merge-multiple: true

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ jobs:
steps:
- name: Setup
run: |
SANITIZED_TAG=$(echo "${GITHUB_REF_NAME}" | sed 's/[./]/-/g')
echo "EXEC_NAME=albyhub" >> $GITHUB_ENV
if [ "${{ runner.os }}" == "macOS" ]; then
echo "PACKAGE_NAME=albyhub-Server-MacOS" >> $GITHUB_ENV
echo "PACKAGE_NAME=AlbyHub-Server-MacOS-${SANITIZED_TAG}" >> $GITHUB_ENV
else
echo "PACKAGE_NAME=albyhub-Server-Linux-${{ matrix.build.arch }}" >> $GITHUB_ENV
echo "PACKAGE_NAME=AlbyHub-Server-Linux-${{ matrix.build.arch }}-${SANITIZED_TAG}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/wails.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ jobs:
- name: Setup
shell: bash
run: |
echo "EXEC_NAME=albyhub" >> $GITHUB_ENV
echo "PACKAGE_NAME=albyhub-Desktop-${{ runner.os }}" >> $GITHUB_ENV
SANITIZED_TAG=$(echo "${GITHUB_REF_NAME}" | sed 's/[./]/-/g')
echo "EXEC_NAME=Alby Hub" >> $GITHUB_ENV
echo "PACKAGE_NAME=AlbyHub-Desktop-${{ runner.os }}-${SANITIZED_TAG}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -105,17 +106,17 @@ jobs:

- name: Build App
if: runner.os == 'macOS'
run: wails build --platform darwin/universal -webview2 embed -o ${{ env.EXEC_NAME }} -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
run: wails build --platform darwin/universal -webview2 embed -o "${{ env.EXEC_NAME }}" -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
shell: bash

- name: Build App
if: runner.os == 'Linux'
run: wails build --platform linux/amd64 -webview2 embed -o ${{ env.EXEC_NAME }} -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
run: wails build --platform linux/amd64 -webview2 embed -o "${{ env.EXEC_NAME }}" -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
shell: bash

- name: Build Windows App
if: runner.os == 'Windows'
run: wails build --platform windows/amd64 -webview2 embed -o ${{ env.EXEC_NAME }}.exe -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
run: wails build --platform windows/amd64 -webview2 embed -o "${{ env.EXEC_NAME }}.exe" -tags "wails" -ldflags "-X 'github.com/getAlby/hub/version.Tag=${{ env.TAG }}'"
shell: bash

- name: Import Code-Signing Certificates for macOS
Expand Down Expand Up @@ -143,36 +144,36 @@ jobs:
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/x86_64-unknown-linux-gnu/libglalby_bindings.so ./build/bin/${{ env.PACKAGE_NAME }}/lib/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/x86_64-unknown-linux-gnu/libldk_node.so ./build/bin/${{ env.PACKAGE_NAME }}/lib/
mkdir -p ./build/bin/${{ env.PACKAGE_NAME }}/bin
mv ./build/bin/${{ env.EXEC_NAME }} ./build/bin/${{ env.PACKAGE_NAME }}/bin/
mv "./build/bin/${{ env.EXEC_NAME }}" ./build/bin/${{ env.PACKAGE_NAME }}/bin/
shell: bash

- name: Patch executable RPATH
if: runner.os == 'Linux'
run: |
patchelf --force-rpath --set-rpath '$ORIGIN/../lib' ./build/bin/${{ env.PACKAGE_NAME }}/bin/${{ env.EXEC_NAME }}
patchelf --force-rpath --set-rpath '$ORIGIN/../lib' "./build/bin/${{ env.PACKAGE_NAME }}/bin/${{ env.EXEC_NAME }}"
- name: Copy shared libraries to the output directory
if: runner.os == 'macOS'
run: |
mkdir -p ./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks
lipo -create -output ./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/libbreez_sdk_bindings.dylib `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-aarch64/libbreez_sdk_bindings.dylib `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-amd64/libbreez_sdk_bindings.dylib
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/universal-macos/libglalby_bindings.dylib ./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/universal-macos/libldk_node.dylib ./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/
mkdir -p "./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks"
lipo -create -output "./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/libbreez_sdk_bindings.dylib" `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-aarch64/libbreez_sdk_bindings.dylib `go list -m -f "{{.Dir}}" github.com/breez/breez-sdk-go`/breez_sdk/lib/darwin-amd64/libbreez_sdk_bindings.dylib
cp `go list -m -f "{{.Dir}}" github.com/getAlby/glalby-go`/glalby/universal-macos/libglalby_bindings.dylib "./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/"
cp `go list -m -f "{{.Dir}}" github.com/getAlby/ldk-node-go`/ldk_node/universal-macos/libldk_node.dylib "./build/bin/${{ env.EXEC_NAME }}.app/Contents/Frameworks/"
shell: bash

- name: Patch executable RPATH
if: runner.os == 'macOS'
run: |
install_name_tool -add_rpath @executable_path/../Frameworks ./build/bin/${{ env.EXEC_NAME }}.app/Contents/MacOS/${{ env.EXEC_NAME }}
install_name_tool -add_rpath @executable_path/../Frameworks "./build/bin/${{ env.EXEC_NAME }}.app/Contents/MacOS/${{ env.EXEC_NAME }}"
- name: Add macOS perms
if: runner.os == 'macOS'
run: chmod +x build/bin/${{ env.EXEC_NAME }}.app/Contents/MacOS/${{ env.EXEC_NAME }}
run: chmod +x "build/bin/${{ env.EXEC_NAME }}.app/Contents/MacOS/${{ env.EXEC_NAME }}"
shell: bash

- name: Add Linux perms
if: runner.os == 'Linux'
run: chmod +x build/bin/${{ env.PACKAGE_NAME }}/bin/${{ env.EXEC_NAME }}
run: chmod +x "build/bin/${{ env.PACKAGE_NAME }}/bin/${{ env.EXEC_NAME }}"
shell: bash

# Store everything in a tar archive to preserve permissions
Expand All @@ -189,7 +190,7 @@ jobs:
if: runner.os == 'macOS'
run: |
echo "Signing Package"
/usr/bin/codesign -s "Developer ID Application: Alby Inc." -f -v --deep --timestamp --options runtime --entitlements ./build/darwin/entitlements.plist ./build/bin/AlbyHub.app
/usr/bin/codesign -s "Developer ID Application: Alby Inc." -f -v --deep --timestamp --options runtime --entitlements ./build/darwin/entitlements.plist "./build/bin/${{ env.EXEC_NAME }}.app"
env:
AC_USERNAME: ${{ secrets.APPLE_USERNAME }}
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
Expand All @@ -199,12 +200,26 @@ jobs:
if: runner.os == 'macOS'
run: |
mkdir -p ./build/out
create-dmg --volname "AlbyHub" --background "./build/darwin/dmgcover.png" --window-pos 200 120 --window-size 800 400 --icon-size 80 --icon "AlbyHub.app" 200 160 --hide-extension "AlbyHub.app" --app-drop-link 600 160 "./build/out/${{ env.PACKAGE_NAME }}.dmg" "./build/bin/${{ env.EXEC_NAME }}.app"
create-dmg --volname "Alby Hub" --background "./build/darwin/dmgcover.png" --window-pos 200 120 --window-size 800 400 --icon-size 80 --icon "${{ env.EXEC_NAME }}.app" 200 160 --hide-extension "${{ env.EXEC_NAME }}.app" --app-drop-link 600 160 "./build/out/${{ env.PACKAGE_NAME }}.dmg" "./build/bin/${{ env.EXEC_NAME }}.app"
rm -Rf ./build/bin/*
mv ./build/out/${{ env.PACKAGE_NAME }}.dmg ./build/bin/
- name: Generate gon-notarize.json
if: runner.os == 'macOS'
run: |
cat > ./build/darwin/gon-notarize.json << EOF
{
"notarize": [
{
"path": "./build/bin/${PACKAGE_NAME}.dmg",
"bundle_id": "com.getalby.AlbyHub"
}
]
}
EOF
- name: Notarize the DMG image
if: runner.os == 'macOS' && inputs.build-release
if: runner.os == 'macOS'
run: |
echo "Notarizing Zip Files"
gon -log-level=info -log-json ./build/darwin/gon-notarize.json
Expand Down
8 changes: 0 additions & 8 deletions build/darwin/gon-notarize.json

This file was deleted.

8 changes: 6 additions & 2 deletions wails.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"$schema": "https://wails.io/schemas/config.v2.json",
"name": "albyhub",
"outputfilename": "albyhub",
"name": "Alby Hub",
"outputfilename": "Alby Hub",
"frontend:install": "yarn install",
"frontend:build": "yarn build:wails",
"frontend:dev:watcher": "yarn dev:wails",
"frontend:dev:serverUrl": "auto",
"author": {
"name": "Alby Contributors",
"email": "[email protected]"
},
"info": {
"companyName": "Alby Inc.",
"productName": "Alby Hub"
}
}
4 changes: 2 additions & 2 deletions wails/wails_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (app *WailsApp) startup(ctx context.Context) {

func LaunchWailsApp(app *WailsApp, assets embed.FS, appIcon []byte) {
err := wails.Run(&options.App{
Title: "AlbyHub",
Title: "Alby Hub",
Width: 1024,
Height: 768,
AssetServer: &assetserver.Options{
Expand All @@ -55,7 +55,7 @@ func LaunchWailsApp(app *WailsApp, assets embed.FS, appIcon []byte) {
},
Mac: &mac.Options{
About: &mac.AboutInfo{
Title: "AlbyHub",
Title: "Alby Hub",
Icon: appIcon,
},
},
Expand Down

0 comments on commit 3b88e18

Please sign in to comment.