Skip to content

Commit

Permalink
fix: 🐛 Fix windows action build ssl issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Aug 8, 2023
2 parents 5531a90 + 1443121 commit 6e6a942
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 28 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/Build-and-deploy-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:

- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: env-electron-python
environment-file: tools/anaconda-env/environment-Linux.yml
auto-update-conda: true
auto-activate-base: false
- run: |
conda activate env-electron-python
conda info
conda list
Expand All @@ -37,10 +40,12 @@ jobs:
- name: Install package.json modules and their dependencies
run: npm install --ignore-scripts

- name: Build and deploy on Linux
- name: Build the python server executable
run: |
npm run python-onefile-build-unix
- name: Deploy the app to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
conda activate env-electron-python
npm run python-onefile-build
npm run deploy-linux
11 changes: 8 additions & 3 deletions .github/workflows/Build-and-deploy-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:

- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: env-electron-python
environment-file: tools/anaconda-env/environment-MAC.yml
auto-update-conda: true
auto-activate-base: false
- run: |
conda activate env-electron-python
conda info
conda list
Expand All @@ -42,12 +45,14 @@ jobs:
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }}
p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }}

- name: Build and deploy on MAC
- name: Build the python server executable
run: |
npm run python-onefile-build-unix
- name: Deploy the app to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
appleId: ${{ secrets.APPLE_ID }}
appleIdPassword: ${{ secrets.APPLE_PASSWORD }}
run: |
conda activate env-electron-python
npm run python-onefile-build
npm run deploy-mac
12 changes: 9 additions & 3 deletions .github/workflows/Build-and-deploy-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.9

- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: env-electron-python
environment-file: tools/anaconda-env/environment-Windows.yml
auto-update-conda: true
auto-activate-base: false
- run: |
conda activate env-electron-python
conda info
conda list
Expand All @@ -37,9 +40,12 @@ jobs:
- name: Install package.json modules and their dependencies
run: npm install --ignore-scripts

- name: Build and deploy on Windows
- name: Build the python server executable
run: |
npm run python-onefile-build-win
- name: Deploy the app to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run python-onefile-build
npm run deploy-win
Binary file added libcrypto-1_1-x64.dll
Binary file not shown.
Binary file added libssl-1_1-x64.dll
Binary file not shown.
11 changes: 7 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,13 @@ const getScriptPath = () => {
return path.join(__dirname, PY_FLASK_FOLDER, PY_FLASK_MODULE + ".py");
}
if (process.platform === "win32") {
return path.join(__dirname, PY_FLASK_DIST_FOLDER, PY_FLASK_MODULE + ".exe");
const winPath = path.join(__dirname, PY_FLASK_DIST_FOLDER, PY_FLASK_MODULE + ".exe");
log.info("Path to server executable: " + winPath);
return winPath;
} else {
log.info("Since app is packaged returning path: ");
return path.join(process.resourcesPath, PY_FLASK_MODULE);
const unixPath = path.join(process.resourcesPath, PY_FLASK_MODULE);
log.info("Path to server executable: " + unixPath);
return unixPath;
}
};
const selectPort = () => {
Expand All @@ -108,7 +111,7 @@ const createPyProc = async () => {
if (require("fs").existsSync(script)) {
log.info("server exists at specified location");
} else {
log.info("server does not exist at specified location");
log.info("server doesn't exist at specified location");
}
fp(PORT, PORT + portRange)
.then(([freePort]) => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "soda-for-sparc",
"productName": "SODA for SPARC",
"version": "12.2.0",
"version": "12.2.1-beta",
"description": "Keep Calm and Curate ",
"main": "main.js",
"scripts": {
Expand All @@ -12,7 +12,8 @@
"deploy-win": "electron-builder build --win --publish always",
"deploy-mac": "electron-builder build --mac --publish always",
"deploy-linux": "electron-builder build --linux --publish always",
"python-onefile-build": "python -m PyInstaller --onefile --clean ./pyflask/app.py --distpath ./pyflaskdist",
"python-onefile-build-unix": "python -m PyInstaller --onefile --clean ./pyflask/app.py --distpath ./pyflaskdist",
"python-onefile-build-win": "python -m PyInstaller --onefile --add-data libcrypto-1_1-x64.dll;. --add-data libssl-1_1-x64.dll;. --clean ./pyflask/app.py --distpath ./pyflaskdist",
"postinstall": "electron-builder install-app-deps",
"format": "prettier --ignore-path .gitignore --ignore-path .prettierignore \"./**/*.+(html|css|js|md|yml)\" --write",
"commit": "cz",
Expand Down
2 changes: 1 addition & 1 deletion pyflask/authentication/authenticate.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ def get_pennsieve_api_key_secret(email, password, keyname):
"name": profile_name
}
except Exception as e:
raise e
raise e
Binary file added pyflask/libcrypto-1_1-x64.dll
Binary file not shown.
Binary file added pyflask/libssl-1_1-x64.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions pyflask/startup/minimumApiVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
def get_api_version():
"""
Returns the version of the API
"""
return {'version': os.getenv('API_VERSION', "12.2.0")}
"""
return {'version': os.getenv('API_VERSION', "12.2.1-beta")}
1 change: 1 addition & 0 deletions scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -14097,6 +14097,7 @@ $(document).ready(async () => {

// when generating a new dataset we need to add its ID to the ID -> Name mapping
// we need to do this only once

// TODO: Reintegrate
let loggedDatasetNameToIdMapping = false;

Expand Down
4 changes: 2 additions & 2 deletions tools/anaconda-env/environment-Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ channels:
- defaults
- conda-forge
dependencies:
- python = 3.9
- python = 3.9.7
- PyInstaller = 4.7
- nodejs = 16.14.2
- libgcc = 7.2.0
- git = 2.20.1
- libgcc = 7.2.0
- pip
- pip:
- chardet == 4.0.0
Expand Down
7 changes: 4 additions & 3 deletions tools/anaconda-env/environment-Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ dependencies:
- python = 3.9.7
- PyInstaller = 4.7
- nodejs = 16.14.2
- pywin32 = 303
- git = 2.20.1
- pywin32 = 303
- setuptools=58.0.4
- pip
- openssl
- pip:
- futures == 3.1.1
- chardet == 4.0.0
Expand All @@ -27,11 +28,11 @@ dependencies:
- flask_restx
- PyInstaller == 4.7
- opencv-python == 4.5.3.56
- certifi == 2021.10.8
- certifi == 2023.7.22
- requests
- boto3
- numpy == 1.23.0
- protobuf == 4.21.12
- pennsieve2 == 0.1.1
- jsonschema == 4.17.3
- urllib3
- urllib3 == 2.0.4
8 changes: 5 additions & 3 deletions tools/anaconda-env/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ altgraph==0.17.3
aniso8601==9.0.1
attrs==22.2.0
biopython==1.79
boto3==1.26.35
botocore==1.29.35
boto3
botocore
certifi==2021.10.8
cffi==1.15.1
chardet==4.0.0
Expand Down Expand Up @@ -42,6 +42,8 @@ pyasn1==0.4.8
pycparser==2.21
pyinstaller==4.7
pyinstaller-hooks-contrib==2022.14
pyOpenSSL==22.0.0
python==3.9.7
pyrsistent==0.19.2
python-dateutil==2.8.2
python-docx==0.8.10
Expand All @@ -55,7 +57,7 @@ s3transfer==0.6.0
semver==2.13.0
six==1.16.0
tqdm==4.64.1
urllib3==1.26.13
urllib3==2.0.4
websocket-client==1.4.2
Werkzeug==2.0.2
wincertstore==0.2
Expand Down

0 comments on commit 6e6a942

Please sign in to comment.