Skip to content

Commit 6fc8699

Browse files
teste 9$
1 parent 6117092 commit 6fc8699

File tree

2 files changed

+86
-80
lines changed

2 files changed

+86
-80
lines changed

.github/workflows/build-linux-legacy.yml

Lines changed: 85 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,73 +10,36 @@
1010
workflow_dispatch:
1111

1212
jobs:
13-
build:
14-
name: Build (${{ matrix.os }})
15-
runs-on: ${{ matrix.os }}
16-
strategy:
17-
fail-fast: false
18-
matrix:
19-
os: [ubuntu-latest, windows-latest]
13+
build-linux:
14+
name: Build Linux
15+
runs-on: ubuntu-latest
2016

2117
steps:
22-
# 1) Checkout
23-
- name: Check out repository
24-
uses: actions/checkout@v4
18+
- uses: actions/checkout@v4
2519

26-
# 2) Setup Python
27-
- name: Set up Python
28-
uses: actions/setup-python@v4
20+
- uses: actions/setup-python@v4
2921
with:
3022
python-version: "3.9"
3123

32-
# 3) Instalar dependências
3324
- name: Install dependencies
3425
run: |
3526
python -m pip install --upgrade pip
3627
pip install -r DocViewerDesktop/requirements.txt
3728
pip install pyinstaller
3829
39-
# 4) Build com PyInstaller (configuração por OS)
40-
- name: Build with PyInstaller
30+
- name: Build with PyInstaller (Linux)
4131
run: |
42-
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
43-
pyinstaller --noconsole --name DocViewer --onefile \
44-
--icon="DocViewerDesktop/resources/icons_svg/doc_icon.ico" \
45-
--add-data "DocViewerDesktop/ui/dark-high-v0.qss:ui" \
46-
--add-data "DocViewerDesktop/resources/icons_svg/*:resources/icons_svg" \
47-
--hidden-import="ui.ui_utils" \
48-
--hidden-import="editor.editor_core" \
49-
--hidden-import="editor.actions.file_actions" \
50-
--hidden-import="editor.actions.edit_actions" \
51-
--exclude-module PySide6.Qt3DCore \
52-
--exclude-module PySide6.Qt3DRender \
53-
--exclude-module PySide6.Qt3DExtras \
54-
--exclude-module PySide6.QtDataVisualization \
55-
--exclude-module PySide6.QtCharts \
56-
--exclude-module PySide6.QtWebEngineWidgets \
57-
DocViewerDesktop/main.py
58-
else
59-
pyinstaller --noconsole --name DocViewer --onefile \
60-
--icon="DocViewerDesktop/resources/icons_svg/doc_icon.ico" \
61-
--add-data "DocViewerDesktop/ui/dark-high-v0.qss;ui" \
62-
--add-data "DocViewerDesktop/resources/icons_svg/*;resources/icons_svg" \
63-
--hidden-import="ui.ui_utils" \
64-
--hidden-import="editor.editor_core" \
65-
--hidden-import="editor.actions.file_actions" \
66-
--hidden-import="editor.actions.edit_actions" \
67-
--exclude-module PySide6.Qt3DCore \
68-
--exclude-module PySide6.Qt3DRender \
69-
--exclude-module PySide6.Qt3DExtras \
70-
--exclude-module PySide6.QtDataVisualization \
71-
--exclude-module PySide6.QtCharts \
72-
--exclude-module PySide6.QtWebEngineWidgets \
73-
DocViewerDesktop/main.py
74-
fi
75-
shell: bash
76-
77-
# 5) Processamento específico para Linux
78-
- name: Linux – Build .deb with FPM
79-
if: matrix.os == 'ubuntu-latest'
32+
pyinstaller --noconsole --name DocViewer --onefile \
33+
--icon="DocViewerDesktop/resources/icons_svg/doc_icon.ico" \
34+
--add-data "DocViewerDesktop/ui/dark-high-v0.qss:ui" \
35+
--add-data "DocViewerDesktop/resources/icons_svg/*:resources/icons_svg" \
36+
--hidden-import="ui.ui_utils" \
37+
--hidden-import="editor.editor_core" \
38+
--hidden-import="editor.actions.file_actions" \
39+
--hidden-import="editor.actions.edit_actions" \
40+
DocViewerDesktop/main.py
41+
42+
- name: Build .deb
8043
run: |
8144
sudo apt-get update
8245
sudo apt-get install -y ruby ruby-dev build-essential
@@ -87,73 +50,116 @@
8750
mkdir -p package/usr/share/icons/hicolor/256x256/apps
8851
8952
cp dist/DocViewer package/usr/local/bin/docviewer
90-
cp DocViewerDesktop/resources/icons_svg/doc_icon.png package/usr/share/icons/hicolor/256x256/apps/docviewer.png
53+
chmod +x package/usr/local/bin/docviewer
54+
55+
cp DocViewerDesktop/resources/icons_svg/doc_icon.png \
56+
package/usr/share/icons/hicolor/256x256/apps/docviewer.png
9157
9258
cat <<EOF > package/usr/share/applications/docviewer.desktop
9359
[Desktop Entry]
9460
Type=Application
9561
Name=DocViewer
96-
Comment=Visualizador de documentos
9762
Exec=/usr/local/bin/docviewer
9863
Icon=docviewer
9964
Terminal=false
10065
Categories=Utility;Office;
101-
StartupNotify=true
10266
EOF
10367
10468
fpm -s dir -t deb \
10569
-n docviewer \
10670
-v 1.1.0 \
10771
--architecture amd64 \
108-
--description "DocViewer Desktop Editor de Documentos" \
109-
--license "GNU General Public License v3.0" \
110-
--maintainer "Ernesto Alves <ernesto487dev@gmail.com>" \
111-
--url "https://github.com/${{ github.repository }}" \
11272
package/
11373
114-
mv docviewer_1.1.0_amd64.deb dist/
74+
mkdir -p artifacts
75+
mv docviewer_1.1.0_amd64.deb artifacts/
76+
77+
- name: Upload Linux artifact
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: linux-deb
81+
path: artifacts/*.deb
82+
83+
build-windows:
84+
name: Build Windows
85+
runs-on: windows-latest
86+
87+
steps:
88+
- uses: actions/checkout@v4
89+
90+
- uses: actions/setup-python@v4
91+
with:
92+
python-version: "3.9"
93+
94+
- name: Install dependencies
95+
run: |
96+
python -m pip install --upgrade pip
97+
pip install -r DocViewerDesktop/requirements.txt
98+
pip install pyinstaller
11599
116-
# 6) Processamento específico para Windows
117-
- name: Windows – Zip artifacts
118-
if: matrix.os == 'windows-latest'
100+
- name: Build with PyInstaller (Windows)
101+
shell: bash
119102
run: |
120-
Compress-Archive -Path dist\DocViewer.exe -DestinationPath dist\docviewer-windows.zip
103+
pyinstaller --noconsole --name DocViewer --onefile \
104+
--icon="DocViewerDesktop/resources/icons_svg/doc_icon.ico" \
105+
--add-data "DocViewerDesktop/ui/dark-high-v0.qss;ui" \
106+
--add-data "DocViewerDesktop/resources/icons_svg/*;resources/icons_svg" \
107+
--hidden-import="ui.ui_utils" \
108+
--hidden-import="editor.editor_core" \
109+
--hidden-import="editor.actions.file_actions" \
110+
--hidden-import="editor.actions.edit_actions" \
111+
DocViewerDesktop/main.py
112+
113+
- name: Zip Windows binary
121114
shell: pwsh
115+
run: |
116+
mkdir artifacts
117+
Compress-Archive -Path dist\DocViewer.exe -DestinationPath artifacts\docviewer-windows.zip
122118
123-
# 7) Criar Release (somente Linux)
124-
- name: Create Release (Linux only)
125-
if: matrix.os == 'ubuntu-latest'
119+
- name: Upload Windows artifact
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: windows-zip
123+
path: artifacts/docviewer-windows.zip
124+
125+
release:
126+
name: Create GitHub Release
127+
runs-on: ubuntu-latest
128+
needs: [build-linux, build-windows]
129+
130+
steps:
131+
- name: Download artifacts
132+
uses: actions/download-artifact@v4
133+
134+
- name: Create Release
126135
id: create_release
127136
uses: actions/create-release@v1
128137
with:
129138
tag_name: v1.1.0
130-
release_name: "DocViewer Release v1.1.0"
139+
release_name: "DocViewer v1.1.0"
131140
draft: false
132141
prerelease: true
133142
env:
134143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135144

136-
# 8) Upload dos artefatos (Linux)
137145
- name: Upload Linux .deb
138-
if: matrix.os == 'ubuntu-latest'
139146
uses: actions/upload-release-asset@v1
140147
with:
141148
upload_url: ${{ steps.create_release.outputs.upload_url }}
142-
asset_path: dist/docviewer_1.1.0_amd64.deb
143-
asset_name: "docviewer-linux.deb"
149+
asset_path: linux-deb/docviewer_1.1.0_amd64.deb
150+
asset_name: docviewer-linux.deb
144151
asset_content_type: application/vnd.debian.binary-package
145152
env:
146153
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147154

148-
# 9) Upload do Windows ZIP (usa a release criada pelo Linux)
149155
- name: Upload Windows ZIP
150-
if: matrix.os == 'windows-latest'
151156
uses: actions/upload-release-asset@v1
152157
with:
153-
# Usa a mesma release criada pelo job Linux
154158
upload_url: ${{ steps.create_release.outputs.upload_url }}
155-
asset_path: dist/docviewer-windows.zip
156-
asset_name: "docviewer-windows.zip"
159+
asset_path: windows-zip/docviewer-windows.zip
160+
asset_name: docviewer-windows.zip
157161
asset_content_type: application/octet-stream
158162
env:
159163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164+
165+

DocViewerDesktop/editor/actions/file_actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def open_initial_File(self, file_path_str=None):
306306

307307
def load_file_content(self):
308308
"""
309-
Recarrega o conteúdo do arquivo monitorado no editor.
309+
Recarrega o conteúdo do arquivo monitorado no editor. chamado quando o arquivo é modificado externamente.
310310
"""
311311
current_index = self.ui.tab_widget.currentIndex()
312312
current_tab = self.ui.tab_widget.widget(current_index)

0 commit comments

Comments
 (0)