-
Notifications
You must be signed in to change notification settings - Fork 255
Provide *-full packages for Linux, and remove container.tar from default ones
#1423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 15 commits
6766d78
7a13788
230e1c4
6269ead
4b94f66
f9b1607
764934a
b9945bf
d729de8
8db71a3
2015e4e
cdec2fe
8703bde
15e752c
f578304
26f92cc
6d881b2
8c6f33c
4de0948
c174332
430f317
8785bee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,8 +118,19 @@ jobs: | |
| # `dangerzone-cli` command and its WSL detection will fail. | ||
| # | ||
| # For this reason, we prefer to run `wsl --update` before the tests. | ||
| # Microsoft's WSL update servers occasionally return HTTP 403, so retry | ||
| # before failing the job. | ||
| - name: Update WSL | ||
| run: wsl --update | ||
| shell: pwsh | ||
| run: | | ||
| $ok = $false | ||
| for ($i = 1; $i -le 5; $i++) { | ||
| wsl --update | ||
| if ($LASTEXITCODE -eq 0) { $ok = $true; break } | ||
| Write-Host "wsl --update attempt $i failed (exit $LASTEXITCODE), retrying..." | ||
| Start-Sleep -Seconds 15 | ||
| } | ||
| if (-not $ok) { exit 1 } | ||
| - name: Smoke test | ||
| run: poetry run dangerzone-cli .\tests\test_docs\sample-pdf.pdf --ocr-lang eng --debug | ||
| - name: Run CLI tests | ||
|
|
@@ -235,7 +246,7 @@ jobs: | |
| poetry run dangerzone-image prepare-archive | ||
| --output share/container.tar | ||
|
|
||
| - name: Build Dangerzone .deb | ||
| - name: Build Dangerzone .deb packages | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
|
|
@@ -250,6 +261,15 @@ jobs: | |
| if-no-files-found: error | ||
| compression-level: 0 | ||
|
|
||
| - name: Upload Dangerzone-full .deb | ||
| if: matrix.distro == 'debian' && matrix.version == 'bookworm' | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: dangerzone-full.deb | ||
| path: "deb_dist/dangerzone-full_*_*.deb" | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
|
|
||
| install-deb: | ||
| name: "install-deb (${{ matrix.distro }} ${{ matrix.version }})" | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -293,6 +313,12 @@ jobs: | |
| --version ${{ matrix.version }} \ | ||
| build | ||
|
|
||
| - name: Download container image | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| run dangerzone-image upgrade | ||
|
|
||
| - name: Run a test command | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
|
|
@@ -305,6 +331,50 @@ jobs: | |
| --version ${{ matrix.version }} \ | ||
| run dangerzone --help | ||
|
|
||
|
|
||
| install-deb-full: | ||
| name: "install-deb-full (${{ matrix.distro }} ${{ matrix.version }})" | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-deb | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - distro: debian | ||
| version: bookworm | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: Download Dangerzone full .deb | ||
| uses: actions/download-artifact@v6 | ||
| with: | ||
| name: dangerzone-full.deb | ||
| path: "deb_dist/" | ||
|
|
||
| - name: Build end-user environment with full package | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| build --full | ||
|
|
||
| - name: Run a test command (container bundled) | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| run dangerzone-cli dangerzone/tests/test_docs/sample-pdf.pdf --ocr-lang eng --debug | ||
|
|
||
| - name: Check that the Dangerzone GUI imports work | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| run dangerzone --help | ||
|
|
||
| build-install-rpm: | ||
| name: "build-install-rpm (${{ matrix.distro }} ${{matrix.version}})" | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -378,7 +448,22 @@ jobs: | |
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: dangerzone-${{ matrix.distro }}-${{ matrix.version }}.rpm | ||
| path: "dist/dangerzone-*.x86_64.rpm" | ||
| path: | | ||
| dist/dangerzone-*.x86_64.rpm | ||
| !dist/dangerzone-full-*.x86_64.rpm | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
|
|
||
| - name: Build Dangerzone-full .rpm | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} --version ${{ matrix.version }} \ | ||
| run --dev --no-gui ./dangerzone/install/linux/build-rpm.py --full | ||
|
|
||
| - name: Upload Dangerzone-full .rpm | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: dangerzone-full-${{ matrix.distro }}-${{ matrix.version }}.rpm | ||
| path: "dist/dangerzone-full-*.x86_64.rpm" | ||
| if-no-files-found: error | ||
| compression-level: 0 | ||
|
|
||
|
|
@@ -394,6 +479,11 @@ jobs: | |
| --version ${{ matrix.version }} \ | ||
| build | ||
|
|
||
| - name: Download container image | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} --version ${{ matrix.version }} \ | ||
| run dangerzone-image upgrade | ||
|
|
||
| - name: Run a test command | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} --version ${{ matrix.version }} \ | ||
|
|
@@ -404,6 +494,49 @@ jobs: | |
| ./dev_scripts/env.py --distro ${{ matrix.distro }} --version ${{ matrix.version }} \ | ||
| run dangerzone --help | ||
|
|
||
| install-rpm-full: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What I mentioned in https://github.com/freedomofpress/dangerzone/pull/1423/changes#r3219532167 also applies here, with the added benefit that:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm actually not sure we want this here. For Debian, because the packages is built once and installed everywhere the story is a bit different, but since here we need to build on each system, I believe we could just build the We could try to depend on some more specific jobs to finish, but I'm not sure the benefit would be worth the cost. Having things run in a separate job is useful to ensure we're not using the local caches (when testing that conversions work)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually implemented this as 430f317 |
||
| name: "install-rpm-full (${{ matrix.distro }} ${{ matrix.version }})" | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-install-rpm | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - distro: fedora | ||
| version: "43" | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Download Dangerzone-full .rpm | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: dangerzone-full-${{ matrix.distro }}-${{ matrix.version }}.rpm | ||
| path: "dist/" | ||
|
|
||
| - name: Build end-user environment with full package | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| build --full | ||
|
|
||
| - name: Run a test command (container bundled) | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| run dangerzone-cli dangerzone/tests/test_docs/sample-pdf.pdf --ocr-lang eng --debug | ||
|
|
||
| - name: Check that the Dangerzone GUI imports work | ||
| run: | | ||
| ./dev_scripts/env.py --distro ${{ matrix.distro }} \ | ||
| --version ${{ matrix.version }} \ | ||
| run dangerzone --help | ||
|
|
||
| run-tests: | ||
| name: "run tests (${{ matrix.distro }} ${{ matrix.version }})" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -511,6 +511,9 @@ def __init__(self, dangerzone: DangerzoneGui) -> None: | |
| task_update_check.needs_user_input.connect( | ||
| self.handle_needs_user_input_enable_updates | ||
| ) | ||
| task_update_check.needs_user_input_download.connect( | ||
| self.handle_needs_user_input_download_container | ||
| ) | ||
|
|
||
| task_container_install.load_container.connect( | ||
| self.status_bar.handle_task_container_install_local | ||
|
|
@@ -685,10 +688,30 @@ def handle_update_check_completed(self) -> None: | |
| self.dangerzone.settings.save() | ||
|
|
||
| def handle_needs_user_input_enable_updates(self) -> None: | ||
| """Handle the prompt to enable updates (container already available).""" | ||
| check = prompt_for_checks(self.dangerzone) | ||
| if check is not None: | ||
| self.dangerzone.settings.set("updater_check_all", check, autosave=True) | ||
|
|
||
| def handle_needs_user_input_download_container( | ||
| self, req: startup.PromptRequest | ||
| ) -> None: | ||
| """Handle the prompt to download container (no container available). | ||
|
|
||
| This is a blocking prompt - the user must accept or the app will shut down. | ||
| """ | ||
| check = prompt_for_checks(self.dangerzone, download_required=True) | ||
| if check is True: | ||
| req.reply(True) | ||
| else: | ||
| # User declined or pressed X - shutdown | ||
| req.reply(False) | ||
| QtCore.QTimer.singleShot(0, self._handle_download_declined) | ||
|
Comment on lines
+708
to
+709
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did we use this method of exiting the app versus |
||
|
|
||
| def _handle_download_declined(self) -> None: | ||
| log.debug("User declined container download, shutting down") | ||
| self.exit(2) | ||
|
|
||
| def handle_needs_user_input_stop_others(self, req: startup.PromptRequest) -> None: | ||
| machine_name = req.req_data["name"] | ||
| log.debug(f"Prompting user to stop Podman machine '{machine_name}'") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.