-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (127 loc) · 4.75 KB
/
Copy pathrelease-all.yml
File metadata and controls
152 lines (127 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build Cross-Platform Releases (Linux & Windows)
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-linux:
name: Build Linux Packages (.deb & .zip)
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller pywebview
- name: Build Linux Distribution with PyInstaller
run: |
pyinstaller --clean distribucion/NetDrop-Linux-x64.spec
- name: Create Linux .zip Package
run: |
cd dist && zip -r NetDrop-Linux-x64.zip netdrop_app/
- name: Prepare & Build .deb Installer Package
run: |
mkdir -p build_deb/DEBIAN
mkdir -p build_deb/usr/bin
mkdir -p build_deb/usr/share/netdrop
if [ -f netdrop-installer/DEBIAN/control ]; then
cp netdrop-installer/DEBIAN/control build_deb/DEBIAN/
else
echo "Package: netdrop" > build_deb/DEBIAN/control
echo "Version: 2.1.2" >> build_deb/DEBIAN/control
echo "Section: utils" >> build_deb/DEBIAN/control
echo "Priority: optional" >> build_deb/DEBIAN/control
echo "Architecture: amd64" >> build_deb/DEBIAN/control
echo "Maintainer: Nexthezia Studios" >> build_deb/DEBIAN/control
echo "Description: Transferencia de archivos ultraligera en red local." >> build_deb/DEBIAN/control
fi
cp -r dist/netdrop_app/* build_deb/usr/share/netdrop/
echo '#!/bin/bash' > build_deb/usr/bin/netdrop
echo '/usr/share/netdrop/NetDrop-Linux-x64 "$@"' >> build_deb/usr/bin/netdrop
chmod 755 build_deb/usr/bin/netdrop
chmod 755 build_deb/DEBIAN
chmod 644 build_deb/DEBIAN/control
chmod -R 755 build_deb/usr/share/netdrop
dpkg-deb --root-owner-group --build build_deb dist/netdrop-installer.deb
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v4
with:
name: linux-artifacts
path: |
dist/NetDrop-Linux-x64.zip
dist/netdrop-installer.deb
build-windows:
name: Build Windows Packages (.exe & .zip)
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Inno Setup
run: choco install innosetup -y
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller pywebview
- name: Build Standalone Portable Exe (OneFile)
run: |
pyinstaller --clean distribucion/NetDrop-Windows-OneFile.spec
- name: Build Directory Distribution for Setup (Folder)
run: |
pyinstaller --clean distribucion/NetDrop-Windows-Folder.spec
- name: Create Inno Setup Installer
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" distribucion/NetDrop-Setup.iss
- name: Create Zip Package
shell: powershell
run: |
Compress-Archive -Path dist/NetDrop-Windows/* -DestinationPath dist/NetDrop-Windows-x64.zip -Force
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v4
with:
name: windows-artifacts
path: |
dist/NetDrop-Windows-Portable.exe
dist/NetDrop-Setup-v2.1.0.exe
dist/NetDrop-Windows-x64.zip
publish-release:
name: Publish Unified GitHub Release (Linux + Windows)
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: (startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch') && success()
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
name: linux-artifacts
path: release-assets/
- name: Download Windows Artifacts
uses: actions/download-artifact@v4
with:
name: windows-artifacts
path: release-assets/
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
name: NetDrop Release ${{ github.ref_name }}
draft: false
prerelease: false
files: release-assets/*
body_path: RELEASE_NOTES.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}