Skip to content

Commit

Permalink
fix(workflow): windows additionnal configuration to resolve bug with …
Browse files Browse the repository at this point in the history
…msi and versionning
  • Loading branch information
camarm-dev committed Jul 8, 2024
1 parent 611fd97 commit 4ee6c9b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ jobs:
working-directory: ./app
run: npm install # change this to npm or pnpm depending on which one you use.

# Additional windows configuration options
- uses: actions/setup-python@v5
if: matrix.platform == 'windows-latest'
with:
python-version: '3.10'
- name: Make configuration changes for windows
if: matrix.platform == 'windows-latest'
run: |
python app/src-tauri/windows_conf.py
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
22 changes: 22 additions & 0 deletions app/src-tauri/windows_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import json


def get_package_json():
with open('app/package.json') as file:
return json.loads(file.read())


def save_package_json(content: dict):
with open('app/package.json', 'w+') as file:
file.write(json.dumps(content))


if __name__ == '__main__':
print("Making changes for Windows MSI build...")
package = get_package_json()
version = package.get('version', '')
valid_version = version.split('-')[0]
print(f"Changing {version} to {valid_version}...")
package['version'] = valid_version
save_package_json(package)

0 comments on commit 4ee6c9b

Please sign in to comment.