Skip to content

Commit

Permalink
Merge branch 'LayerTwo-Labs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitprodigy authored Apr 19, 2024
2 parents 838b899 + 171cc7a commit 7365f00
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 21 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
workflow_dispatch:

jobs:
build:
Expand Down Expand Up @@ -73,3 +74,34 @@ jobs:
--issuer ${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }} \
--key-id ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} \
--key ./notarization_api_key.p8
upload-artifacts-to-releases-drivechain-info:
name: Upload artifacts to releases.drivechain.info
runs-on: ubuntu-latest
needs: [build]
# avoid uploading on PRs!
if: github.event_name == 'push' && github.repository_owner == 'LayerTwo-Labs'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Create zip files for releases.drivechain.info
run: |
mv drivechain_launcher_linux drivechain-launcher-latest-x86_64-unknown-linux-gnu
zip -r drivechain-launcher-latest-x86_64-unknown-linux-gnu.zip drivechain-launcher-latest-x86_64-unknown-linux-gnu/*
mv drivechain_launcher_macos drivechain-launcher-latest-x86_64-apple-darwin
zip -r drivechain-launcher-latest-x86_64-apple-darwin.zip drivechain-launcher-latest-x86_64-apple-darwin/*
mv drivechain_launcher_windows drivechain-launcher-latest-x86_64-w64
zip -r drivechain-launcher-latest-x86_64-w64.zip drivechain-launcher-latest-x86_64-w64/*
- name: Upload release assets to releases.drivechain.info
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: 45.33.96.47
user: root
pass: ${{ secrets.RELEASES_SERVER_PW }}
port: 22
scp: |
'drivechain-launcher-latest-*.zip' => '/var/www/html/'
54 changes: 33 additions & 21 deletions autoloads/appstate.gd
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,17 @@ func get_ethsail_wallet_path() -> String:
return "%s\\AppData\\Roaming\\Ethereum\\keystore" % home_dir_path

func get_zsail_wallet_path() -> String:
var home_dir_path: String = OS.get_environment("HOME") if OS.get_name() in ["Linux", "macOS"] else OS.get_environment("USERPROFILE")
return "%s/.zcash/regtest/wallet.dat" % home_dir_path
var os_name := OS.get_name()
var zsail_provider = chain_providers["zsail"]
var home_dir_path : String
match os_name:
"Linux":
home_dir_path = OS.get_environment("HOME") + "/" + zsail_provider.wallet_dir_linux
"macOS":
home_dir_path = OS.get_environment("HOME") + "/" + zsail_provider.wallet_dir_mac
_:
return "Error: Unsupported OS"
return home_dir_path


func get_keystore_path() -> String:
Expand Down Expand Up @@ -252,29 +261,31 @@ func delete_ethereum_directory():

func delete_zcash_directory():
var os_name = OS.get_name()
var command = ""
var command = "sh"
var arguments = PackedStringArray()
var output = Array()
var error_output = Array()
var home_path = OS.get_environment("HOME") if OS.get_name() == "Linux" else OS.get_environment("USERPROFILE") # X11 is Linux
var zcash_path = home_path + "/.zcash" if OS.get_name() == "Linux" else home_path + "\\.zcash"

if os_name == "Windows":
command = "cmd.exe"
arguments.push_back("/C")
var deletion_command = "rmdir /s /q \"" + zcash_path + "\""
arguments.push_back(deletion_command)
elif os_name == "Linux":
command = "sh"
arguments.push_back("-c")
var deletion_command = "rm -rf \"" + zcash_path + "\""
arguments.push_back(deletion_command)
else:
print("Unsupported operating system: " + os_name)
return


# Determine the home path and set the Zcash directory path based on the operating system
var home_path = OS.get_environment("HOME")
var zcash_path = ""

match os_name:
"Linux":
zcash_path = home_path + "/.zcash-drivechain"
"macOS":
zcash_path = home_path + "/ZcashDrivechain"
_:
print("Unsupported operating system: " + os_name)
return

print("Attempting to delete: " + zcash_path)


# Setup command to delete the directory
arguments.push_back("-c")
arguments.push_back("rm -rf \"" + zcash_path + "\"")

# Execute the command and handle output
var result = OS.execute(command, arguments, output, true, true)
if result == OK and output.size() == 0:
print("Successfully deleted: " + zcash_path)
Expand All @@ -286,6 +297,7 @@ func delete_zcash_directory():
print("Reason: Unknown error.")



func setup_wallets_backup_directory():
var backup_dir_name := "wallets_backup"
var user_data_dir := OS.get_user_data_dir()
Expand Down

0 comments on commit 7365f00

Please sign in to comment.