Conversation
for more information, see https://pre-commit.ci
Built datashuttle executable with PyInstaller
8e52ff3 to
6685bf7
Compare
79049d6 to
5b6a91c
Compare
5660e9e to
a941e13
Compare
c5b5c6a to
9c95587
Compare
00cf5ae to
acdaada
Compare
…s-unit/datashuttle into cross-platform-packaging
for more information, see https://pre-commit.ci
554cd8a to
5f06120
Compare
| runs-on: windows-latest | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: powershell | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Conda | ||
| uses: conda-incubator/setup-miniconda@v3 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| auto-update-conda: true | ||
| channels: conda-forge | ||
| activate-environment: "datashuttle-test" | ||
|
|
||
| - name: Install rclone | ||
| run: | | ||
| conda activate datashuttle-test | ||
| conda install -c conda-forge rclone | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install .[dev] | ||
| pip install pyinstaller | ||
|
|
||
| # Install Inno Setup silently | ||
| - name: Install Inno Setup | ||
| run: | | ||
| choco install innosetup --yes | ||
|
|
||
| - name: Verify Inno Setup installation | ||
| run: | | ||
| Get-Command "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" | ||
|
|
||
| - name: Run Windows packaging script | ||
| run: | | ||
| python package/package_windows.py | ||
|
|
||
| - name: Upload installer artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-installer | ||
| path: package\Output\datashuttle_0.0.0.exe |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 days ago
In general, to fix this class of problem you need to define a permissions block that explicitly restricts the GITHUB_TOKEN to the least privileges the workflow actually needs. You can add this either at the top (root) of the workflow to apply to all jobs, or under a specific job to limit only that job.
For this particular workflow, the build-windows job only checks out code and uploads an artifact; it doesn’t push code, modify releases, or interact with issues/PRs. These operations work with contents: read, and actions/upload-artifact does not require any repository write permissions. The best minimal fix is therefore to add a root-level permissions block just after the name: (or after on:) with contents: read. This documents the intent and ensures the token cannot be used to write to the repo even if organization defaults are broader.
Concretely:
- Edit
.github/workflows/package_windows.yml. - Insert a root-level
permissions:mapping near the top of the file (e.g., after line 2 or after theon:block) withcontents: read. - No other steps or actions in the shown workflow require additional scopes, so no further permissions are necessary.
| @@ -1,5 +1,8 @@ | ||
| name: windows-build | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] |
This PR introduces cross-platform packaging of datashuttle. This requires both packaging datashuttle itself as well as vendoring a terminal emulator to deal with some rendering issues.
The packaging process is threefold:
Currently, this PR:
Currently the architecture is:
datashuttle.specis shared between operating systems, and is the pyinstaller config file to control packaging of datashuttle itself. It will package datashuttle itself, by packaging thedatashuttle_launcher.pyscript. This will then create a executable to be called in the vendored terminal emulator.package_windows.py,package_macos.py,package_linux.py). These coordinate the download of the terminal emulator to vendor, packaging of datashuttle, then triggers the running ofterminal_launcher_xxx.spec(one for macos, 'windows' is currently used by Windows and Linux) which in turn packagesterminal_launcher.py. This handles how the vendored terminal should call the datashuttle executable.So essentially, the idea is to package datashuttle, and then package a script that opens the vendored terminal and runs the datashuttle executable within it.
One the packaging is complete, we will need to extend the CI to run these installers, generate the artifact to distribute, and add it to the website.
Note that this PR is still in the prototype phase and requires some refactoring and tidying up.
TODO:
windows, check all raw "rclone" calls and make sure they use the new "get_command". Need to add this new convention to dev docs
It might be possible to use the cmd key on Wezterm!
config.send_composed_key_when_left_alt_is_pressed = true
config.macos_forward_to_ime_modifier_mask = "SHIFT|CTRL"