Skip to content

Commit

Permalink
rv useless imports + add font import back
Browse files Browse the repository at this point in the history
  • Loading branch information
SpliiT committed Oct 1, 2024
2 parents e725c6d + cb928db commit 3278deb
Show file tree
Hide file tree
Showing 13 changed files with 10,588 additions and 7,422 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

release:
runs-on: ${{ matrix.os }}
Expand All @@ -32,21 +34,29 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Node.js, NPM
- name: Setup Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: latest
- name: Package
run: |
dotnet tool install --global AzureSignTool --version 4.0.1
jq '.version = "${{ needs.semantic.outputs.version }}"' package.json > temp && mv temp package.json
cat package.json
rm -rf node_modules package-lock.json
npm install
npm run package
shell: bash
env:
AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }}
- name: Release
run: |
gh release upload v${{ needs.semantic.outputs.version }} release/${{ needs.semantic.outputs.version }}/*.zip
cd release/${{ needs.semantic.outputs.version }}
gh release upload v${{ needs.semantic.outputs.version }} geodeapp* latest*
shell: bash

merge:
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,5 @@ logs
/electron-server/venv_viewer
/release
/uploads
geodeapp_back
geodeapp_back.spec
geodeapp_viewer
geodeapp_viewer.spec
geodeapp_back*
geodeapp_viewer*
19 changes: 9 additions & 10 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
branches: [
{ name: "master" },
{ name: "next", channel: "next", prerelease: "rc" }
],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/github'
]
}
branches:
[{ name: "master" }, { name: "next", channel: "next", prerelease: "rc" }],
plugins:
[
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
],
}
2 changes: 2 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

@import "@fontsource/michroma";

* {
font-family: "Roboto", sans-serif;
user-select: none;
Expand Down
18 changes: 5 additions & 13 deletions components/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,16 @@
</template>

<script setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
const drawer = ref(true);
const newproject = ref(false);
const openproject = ref(false);
const router = useRouter();
const items = ref([
{
title: "Back",
icon: "mdi-arrow-left",
click: () => router.back(),
},
{
title: "Home",
icon: "mdi-home",
click: () => router.push("/"),
click: () => navigateTo("/"),
},
{
title: "New Project",
Expand All @@ -150,22 +142,22 @@ const items = ref([
{
title: "Supperposition",
icon: "mdi-layers",
click: () => router.push("/supperposition"),
click: () => navigateTo("/supperposition"),
},
{
title: "Download",
icon: "mdi-upload",
click: () => router.push("/download"),
click: () => navigateTo("/download"),
},
{
title: "Extensions",
icon: "mdi-puzzle",
click: () => router.push("/treeobject"),
click: () => navigateTo("/contextualmenu"),
},
{
title: "Settings",
icon: "mdi-cog",
click: () => router.push("/settings"),
click: () => navigateTo("/settings"),
},
]);
Expand Down
8 changes: 8 additions & 0 deletions customSign.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const child_process = require("child_process");

exports.default = async function(configuration) {
console.log("customSign", configuration);

child_process.execSync(`AzureSignTool sign --azure-key-vault-url "${process.env.AZURE_KEY_VAULT_URI}" --azure-key-vault-client-id "${process.env.AZURE_CLIENT_ID}" --azure-key-vault-tenant-id "${process.env.AZURE_TENANT_ID}" --azure-key-vault-client-secret "${process.env.AZURE_CLIENT_SECRET}" --azure-key-vault-certificate ${process.env.AZURE_CERT_NAME} --timestamp-rfc3161 http://timestamp.digicert.com -v ${configuration.path}`, {stdio: "inherit"});

}
24 changes: 11 additions & 13 deletions electron-builder.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
"asar": false,
"asar": true,
"directories": {
"output": "release/${version}"
},
Expand All @@ -9,28 +9,26 @@
"dist-electron"
],
"extraResources": [
"geodeapp_back",
"geodeapp_viewer"
"./geodeapp_back*",
"./geodeapp_viewer*"
],
"linux": {
"artifactName": "${productName}_${platform}_${version}.${ext}",
"target": [
{
"target": "zip"
}
]
"category": "Science",
"target": ["AppImage", "zip"],
"publish": ["github"]
},
"win": {
"artifactName": "${productName}_${platform}_${version}.${ext}",
"target": [
{
"target": "zip"
}
]
"sign": "./customSign.js",
"signingHashAlgorithms": ["sha256"],
"target": ["nsis", "zip"],
"publish": ["github"]
},
"publish": [
{
"provider": "github",
"host": "github.com",
"owner": "Geode-solutions",
"repo": "GeodeApp"
}
Expand Down
18 changes: 9 additions & 9 deletions electron-server/install_back.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Remove-Item -Recurse -Force /electron-server/venv_back/ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force /electron-server/dist_back/ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force /electron-server/build/ -ErrorAction:SilentlyContinue
$folder="electron-server/venv_back"
Remove-Item -Recurse -Force .\electron-server\venv_back\ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force .\electron-server\dist_back\ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force .\electron-server\build\ -ErrorAction:SilentlyContinue
$folder=".\electron-server\venv_back"
python -m venv $folder

$bin_folder = $folder + "/Lib/site-packages/geodeapp_back"
electron-server/venv_back/Scripts/Activate
$bin_folder = $folder + "\Lib\site-packages\geodeapp_back"
.\electron-server\venv_back\Scripts\Activate

pip install -r electron-server/requirements_back.txt
pip install -r .\electron-server\requirements_back.txt
pip install pyinstaller
pyinstaller --onefile --collect-data opengeodeweb_back --collect-data geodeapp_back $bin_folder/app.py --distpath ./electron-server/dist_back -n geodeapp_back --clean
Copy-Item ./electron-server/dist_back/geodeapp_back.exe ./resources
pyinstaller --onefile --collect-data opengeodeweb_back --collect-data geodeapp_back $bin_folder\app.py --distpath .\electron-server\dist_back -n geodeapp_back --clean
Copy-Item .\electron-server\dist_back\geodeapp_back.exe .\
18 changes: 9 additions & 9 deletions electron-server/install_viewer.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Remove-Item -Recurse -Force /electron-server/venv_viewer/ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force /electron-server/dist_viewer/ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force /electron-server/build/ -ErrorAction:SilentlyContinue
$folder="electron-server/venv_viewer"
Remove-Item -Recurse -Force .\electron-server\venv_viewer\ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force .\electron-server\dist_viewer\ -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force .\electron-server\build\ -ErrorAction:SilentlyContinue
$folder=".\electron-server\venv_viewer"
python -m venv $folder

$bin_folder = $folder + "/Lib/site-packages/geodeapp_viewer"
electron-server/venv_viewer/Scripts/Activate
$bin_folder = $folder + "\Lib\site-packages\geodeapp_viewer"
.\electron-server\venv_viewer\Scripts\Activate

pip install -r electron-server/requirements_viewer.txt
pip install -r .\electron-server\requirements_viewer.txt
pip install pyinstaller
pyinstaller --onefile --collect-data opengeodeweb_viewer --collect-all vtkmodules ./electron-server/venv_viewer/Lib/site-packages/geodeapp_viewer/app.py --distpath ./electron-server/dist_viewer -n geodeapp_viewer --clean
Copy-Item ./electron-server/dist_viewer/geodeapp_viewer.exe ./resources
pyinstaller --onefile --collect-data opengeodeweb_viewer --collect-all vtkmodules $bin_folder\app.py --distpath .\electron-server\dist_viewer -n geodeapp_viewer --clean
Copy-Item .\electron-server\dist_viewer\geodeapp_viewer.exe .\
56 changes: 37 additions & 19 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
import { app, BrowserWindow, ipcMain, dialog } from "electron";
import { updateElectronApp } from "update-electron-app";
import { autoUpdater } from "electron-updater";
import child_process from "child_process";
import path from "path";

const { getPort } = require("get-port-please");
const os = require("os");

// Checks for updates
updateElectronApp();

autoUpdater.checkForUpdatesAndNotify()
process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";

const data_folder_path = `${os.tmpdir()}/vease/`;

function resource_path() {
if (app.isPackaged) {
return process.resourcesPath
}
return app.getAppPath()
}

function executable_name(name) {
if (process.platform === "win32") {
return name + ".exe"
}
return name
}
const data_folder_path = path.join(os.tmpdir(), "vease");

var processes = [];

async function getAvailablePort(port) {
const available_port = await getPort({ port });
const available_port = await getPort({ port, host: "0.0.0.0" });
console.log("available_port", available_port);
return available_port;
}
Expand Down Expand Up @@ -73,6 +88,8 @@ async function run_script(
break;
}
});
child.name = command.replace(/^.*[\\/]/, '')
processes.push(child);
});
}

Expand Down Expand Up @@ -113,12 +130,8 @@ app.whenReady().then(() => {
ipcMain.handle("run_back", async (event, ...args) => {
const port = await getAvailablePort(args[0]);
console.log("BACK PORT", port);
var command;
if (process.platform === "win32") {
command = "resources/geodeapp_back.exe";
} else if (process.platform === "linux") {
command = "./resources/geodeapp_back";
}
const command = path.join(resource_path(), executable_name("geodeapp_back"));
console.log("command", command)
await run_script(
win,
command,
Expand All @@ -137,12 +150,8 @@ app.whenReady().then(() => {
ipcMain.handle("run_viewer", async (event, ...args) => {
const port = await getAvailablePort(args[0]);
console.log("VIEWER PORT", port);
var command;
if (process.platform === "win32") {
command = "resources/geodeapp_viewer.exe";
} else if (process.platform === "linux") {
command = "./resources/geodeapp_viewer";
}
const command = path.join(resource_path(), executable_name("geodeapp_viewer"));
console.log("command", command)
await run_script(
win,
command,
Expand All @@ -152,15 +161,24 @@ app.whenReady().then(() => {
return port;
});
if (app.isPackaged) {
console.log("process.resourcesPath", process.resourcesPath);
win.loadFile(process.resourcesPath + "/app/.output/public/index.html");
const app_path = path.join(app.getAppPath(), ".output", "public", "index.html")
console.log("APP_PATH", app_path)
win.loadFile(app_path);
} else {
console.log("VITE_DEV_SERVER_URL", process.env.VITE_DEV_SERVER_URL);
win.loadURL(process.env.VITE_DEV_SERVER_URL);
win.webContents.openDevTools();
}
});

// App close handler
app.on('before-quit', function () {
processes.forEach(function (proc) {
console.log('Process %s has been killed!', proc.name);
proc.kill();
});
});

// Quit when all windows are closed.
app.on("window-all-closed", () => {
app.quit();
Expand Down
Loading

0 comments on commit 3278deb

Please sign in to comment.