Skip to content

Commit 43ec6c5

Browse files
teste 12@
1 parent 27a97f6 commit 43ec6c5

File tree

2 files changed

+47
-23
lines changed

2 files changed

+47
-23
lines changed

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

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,35 @@ on:
44
push:
55
branches:
66
- linux-release
7-
tags: [ "*" ]
7+
tags:
8+
- "*"
89
paths:
9-
- 'DocViewerDesktop/**'
10+
- "DocViewerDesktop/**"
1011
workflow_dispatch:
1112

1213
env:
13-
VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('{0}-dev', github.run_number) }}
14+
APP_NAME: docviewer
1415

1516
jobs:
1617
build-linux:
17-
name: Build Linux
18+
name: Build Linux (.deb)
1819
runs-on: ubuntu-latest
1920

2021
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v4
22+
- uses: actions/checkout@v4
2323

24-
- name: Setup Python
25-
uses: actions/setup-python@v4
24+
- uses: actions/setup-python@v4
2625
with:
2726
python-version: "3.9"
2827

28+
- name: Set version
29+
run: |
30+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
31+
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
32+
else
33+
echo "VERSION=0.0.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
34+
fi
35+
2936
- name: Install dependencies
3037
run: |
3138
python -m pip install --upgrade pip
@@ -51,20 +58,27 @@ jobs:
5158
sudo gem install --no-document fpm
5259
5360
mkdir -p package/opt/docviewer
61+
mkdir -p package/usr/bin
5462
mkdir -p package/usr/share/applications
5563
mkdir -p package/usr/share/icons/hicolor/256x256/apps
5664
5765
cp -r dist/DocViewer/* package/opt/docviewer/
5866
chmod +x package/opt/docviewer/DocViewer
5967
68+
cat <<'EOF' > package/usr/bin/docviewer
69+
#!/bin/sh
70+
exec /opt/docviewer/DocViewer "$@"
71+
EOF
72+
chmod +x package/usr/bin/docviewer
73+
6074
cp DocViewerDesktop/resources/icons_svg/doc_icon.png \
6175
package/usr/share/icons/hicolor/256x256/apps/docviewer.png
6276
6377
cat <<EOF > package/usr/share/applications/docviewer.desktop
6478
[Desktop Entry]
6579
Type=Application
6680
Name=DocViewer
67-
Exec=/opt/docviewer/DocViewer
81+
Exec=docviewer
6882
Icon=docviewer
6983
Terminal=false
7084
Categories=Utility;Office;
@@ -74,6 +88,10 @@ jobs:
7488
-n docviewer \
7589
-v "$VERSION" \
7690
--architecture amd64 \
91+
--depends "libglib2.0-0" \
92+
--depends "libxkbcommon0" \
93+
--depends "libxcb1" \
94+
--depends "libgl1" \
7795
package/
7896
7997
mkdir -p artifacts
@@ -86,18 +104,25 @@ jobs:
86104
path: artifacts/*.deb
87105

88106
build-windows:
89-
name: Build Windows
107+
name: Build Windows (zip)
90108
runs-on: windows-latest
91109

92110
steps:
93-
- name: Checkout
94-
uses: actions/checkout@v4
111+
- uses: actions/checkout@v4
95112

96-
- name: Setup Python
97-
uses: actions/setup-python@v4
113+
- uses: actions/setup-python@v4
98114
with:
99115
python-version: "3.9"
100116

117+
- name: Set version
118+
shell: bash
119+
run: |
120+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
121+
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
122+
else
123+
echo "VERSION=0.0.${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
124+
fi
125+
101126
- name: Install dependencies
102127
run: |
103128
python -m pip install --upgrade pip
@@ -121,29 +146,29 @@ jobs:
121146
shell: pwsh
122147
run: |
123148
mkdir artifacts
124-
Compress-Archive -Path dist\DocViewer -DestinationPath artifacts\docviewer-windows.zip
149+
Compress-Archive -Path dist\DocViewer\* `
150+
-DestinationPath artifacts\docviewer-windows-${env:VERSION}.zip
125151
126152
- name: Upload Windows artifact
127153
uses: actions/upload-artifact@v4
128154
with:
129155
name: windows-zip
130-
path: artifacts/docviewer-windows.zip
156+
path: artifacts/*.zip
131157

132158
release:
133159
name: Create GitHub Release
134160
runs-on: ubuntu-latest
135161
needs: [build-linux, build-windows]
136162

137163
steps:
138-
- name: Download artifacts
139-
uses: actions/download-artifact@v4
164+
- uses: actions/download-artifact@v4
140165

141166
- name: Create Release
142167
id: create_release
143168
uses: actions/create-release@v1
144169
with:
145-
tag_name: ${{ env.VERSION }}
146-
release_name: "DocViewer ${{ env.VERSION }}"
170+
tag_name: v${{ env.VERSION }}
171+
release_name: "DocViewer v${{ env.VERSION }}"
147172
draft: false
148173
prerelease: true
149174
env:
@@ -154,7 +179,7 @@ jobs:
154179
with:
155180
upload_url: ${{ steps.create_release.outputs.upload_url }}
156181
asset_path: linux-deb/docviewer_${{ env.VERSION }}_amd64.deb
157-
asset_name: docviewer-linux.deb
182+
asset_name: docviewer-linux-amd64.deb
158183
asset_content_type: application/vnd.debian.binary-package
159184
env:
160185
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -163,7 +188,7 @@ jobs:
163188
uses: actions/upload-release-asset@v1
164189
with:
165190
upload_url: ${{ steps.create_release.outputs.upload_url }}
166-
asset_path: windows-zip/docviewer-windows.zip
191+
asset_path: windows-zip/docviewer-windows-${{ env.VERSION }}.zip
167192
asset_name: docviewer-windows.zip
168193
asset_content_type: application/octet-stream
169194
env:

DocViewerDesktop/editor/actions/file_actions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def renameTab(self, tab_index, tab_widget):
6262
file_path = self.ui.open_files[tab_widget][0] # Caminho atual do arquivo
6363
current_dir = os.path.dirname(file_path) # Diretório atual do arquivo
6464

65-
# Solicita um novo nome para o arquivo
6665
new_name, ok = QInputDialog.getText(self, "Renomear arquivo",
6766
"Novo nome para o arquivo:",
6867
text=os.path.basename(current_name))

0 commit comments

Comments
 (0)