This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
forked from getAlby/nostr-wallet-connect
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/master' into release-wails
# Conflicts: # .github/workflows/wails2.yaml
- Loading branch information
Showing
101 changed files
with
3,202 additions
and
1,350 deletions.
There are no files selected for viewing
This file contains 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,35 @@ | ||
name: Code quality - linting and typechecking | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
linting: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
cache: "yarn" | ||
cache-dependency-path: frontend/yarn.lock | ||
|
||
- run: yarn install | ||
- run: yarn prepare:http | ||
|
||
- name: Linting | ||
run: yarn lint:js | ||
|
||
- name: Prettier | ||
run: yarn format | ||
|
||
- name: Typechecking | ||
run: yarn tsc:compile |
This file contains 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 |
---|---|---|
|
@@ -8,11 +8,12 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: [ | ||
{name: albyhub, platform: linux/amd64, os: ubuntu-20.04}, | ||
{name: albyhub, platform: windows/amd64, os: windows-2019}, | ||
{name: albyhub, platform: darwin/universal, os: macos-12} | ||
] | ||
build: | ||
[ | ||
{ name: albyhub, platform: linux/amd64, os: ubuntu-20.04 }, | ||
{ name: albyhub, platform: windows/amd64, os: windows-2019 }, | ||
{ name: albyhub, platform: darwin/universal, os: macos-12 }, | ||
] | ||
runs-on: ${{ matrix.build.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -47,7 +48,7 @@ jobs: | |
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20.x' | ||
node-version: "20.x" | ||
|
||
- name: Install Wails | ||
run: go install github.com/wailsapp/wails/v2/cmd/[email protected] | ||
|
@@ -60,7 +61,9 @@ jobs: | |
|
||
- name: Install macOS Wails deps | ||
if: runner.os == 'macOS' | ||
run: brew install mitchellh/gon/gon | ||
run: | | ||
brew install create-dmg | ||
brew install Bearer/tap/gon | ||
shell: bash | ||
|
||
- name: Wails Doctor | ||
|
@@ -84,19 +87,28 @@ jobs: | |
|
||
- name: Build App | ||
if: runner.os == 'macOS' | ||
run: wails build --platform darwin/universal -webview2 download -o ${{ matrix.build.name }} -tags "wails" | ||
run: wails build --platform darwin/universal -webview2 embed -o ${{ matrix.build.name }} -tags "wails" | ||
shell: bash | ||
|
||
- name: Build App | ||
if: runner.os == 'Linux' | ||
run: wails build --platform linux/amd64 -webview2 download -o ${{ matrix.build.name }} -tags "wails" | ||
run: wails build --platform linux/amd64 -webview2 embed -o ${{ matrix.build.name }} -tags "wails" | ||
shell: bash | ||
|
||
- name: Build Windows App | ||
if: runner.os == 'Windows' | ||
run: wails build --platform windows/amd64 -webview2 download -o ${{ matrix.build.name }}.exe -tags "wails" | ||
run: wails build --platform windows/amd64 -webview2 embed -o ${{ matrix.build.name }}.exe -tags "wails" | ||
shell: bash | ||
|
||
- name: Import Code-Signing Certificates for macOS | ||
if: runner.os == 'macOS' | ||
uses: Apple-Actions/import-codesign-certs@v1 | ||
with: | ||
# The certificates in a PKCS12 file encoded as a base64 string | ||
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }} | ||
# The password used to import the PKCS12 file. | ||
p12-password: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} | ||
|
||
- name: Copy DLLs to the output directory | ||
if: runner.os == 'Windows' | ||
run: | | ||
|
@@ -155,14 +167,34 @@ jobs: | |
rm -Rf ./build/bin/* | ||
mv ./build/out/albyhub-${{runner.os}}.tar.bz2 ./build/bin/ | ||
- name: Sign the macOS binary | ||
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 | ||
env: | ||
AC_USERNAME: ${{ secrets.APPLE_USERNAME }} | ||
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
AC_PROVIDER: ${{ secrets.APPLE_TEAM_ID }} | ||
|
||
- name: Make DMG image for macOS | ||
if: runner.os == 'macOS' | ||
run: | | ||
mkdir -p ./build/out | ||
hdiutil create -volname "AlbyHub" -srcfolder ./build/bin/${{ matrix.build.name }}.app -ov -format UDZO ./build/out/albyhub-${{runner.os}}.dmg | ||
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/albyhub-${{runner.os}}.dmg" "./build/bin/${{ matrix.build.name }}.app" | ||
rm -Rf ./build/bin/* | ||
mv ./build/out/albyhub-${{runner.os}}.dmg ./build/bin/ | ||
- name: Notarize the DMG image | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "Notarizing Zip Files" | ||
gon -log-level=info -log-json ./build/darwin/gon-notarize.json | ||
env: | ||
AC_USERNAME: ${{ secrets.APPLE_USERNAME }} | ||
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
AC_PROVIDER: ${{ secrets.APPLE_TEAM_ID }} | ||
|
||
- name: Make Windows ZIP archive | ||
if: runner.os == 'Windows' | ||
run: | | ||
|
This file contains 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 |
---|---|---|
|
@@ -14,7 +14,7 @@ frontend/node_modules | |
frontend/wailsjs | ||
package.json.md5 | ||
|
||
build | ||
build/bin | ||
|
||
*.log | ||
|
||
|
This file contains 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 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 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 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,56 @@ | ||
package api | ||
|
||
import ( | ||
"encoding/json" | ||
"errors" | ||
"fmt" | ||
"io" | ||
"net/http" | ||
"time" | ||
|
||
"github.com/sirupsen/logrus" | ||
) | ||
|
||
func (api *api) RequestEsploraApi(endpoint string) (interface{}, error) { | ||
url := api.svc.GetConfig().GetEnv().LDKEsploraServer + endpoint | ||
|
||
client := http.Client{ | ||
Timeout: time.Second * 10, | ||
} | ||
|
||
req, err := http.NewRequest(http.MethodGet, url, nil) | ||
if err != nil { | ||
api.logger.WithError(err).WithFields(logrus.Fields{ | ||
"url": url, | ||
}).Error("Failed to create http request") | ||
return nil, err | ||
} | ||
|
||
res, err := client.Do(req) | ||
if err != nil { | ||
api.logger.WithError(err).WithFields(logrus.Fields{ | ||
"url": url, | ||
}).Error("Failed to send request") | ||
return nil, err | ||
} | ||
|
||
defer res.Body.Close() | ||
|
||
body, readErr := io.ReadAll(res.Body) | ||
if readErr != nil { | ||
api.logger.WithError(err).WithFields(logrus.Fields{ | ||
"url": url, | ||
}).Error("Failed to read response body") | ||
return nil, errors.New("failed to read response body") | ||
} | ||
|
||
var jsonContent interface{} | ||
jsonErr := json.Unmarshal(body, &jsonContent) | ||
if jsonErr != nil { | ||
api.logger.WithError(jsonErr).WithFields(logrus.Fields{ | ||
"url": url, | ||
}).Error("Failed to deserialize json") | ||
return nil, fmt.Errorf("failed to deserialize json %s %s", url, string(body)) | ||
} | ||
return jsonContent, nil | ||
} |
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.