Skip to content

Commit 79d01bd

Browse files
authored
Update release.yml
1 parent b084b69 commit 79d01bd

1 file changed

Lines changed: 20 additions & 18 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -171,26 +171,26 @@ jobs:
171171
- name: Build RPM package (Linux x86_64 only)
172172
if: matrix.os == 'ubuntu-22.04' && matrix.target == 'x86_64-linux-gnu'
173173
run: |
174-
# Install rpm tools
175-
sudo apt-get install -y rpm
174+
# Install rpm tools and build dependencies
175+
sudo apt-get install -y rpm rpmbuild rpm-build
176176
177177
# Create RPM build structure
178178
mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
179179
180-
# Create spec file
181-
cat > ~/rpmbuild/SPECS/netmgr.spec << 'EOF'
180+
# Get current date for changelog
181+
CHANGELOG_DATE=$(date +'%a %b %d %Y')
182+
183+
# Create spec file with proper date
184+
cat > ~/rpmbuild/SPECS/netmgr.spec << EOF
182185
Name: netmgr
183-
Version: %{getenv:GITHUB_REF_NAME}
186+
Version: ${{ github.ref_name }}
184187
Release: 1%{?dist}
185188
Summary: Cross-platform network management tool
186189
187190
License: MIT
188-
URL: https://github.com/netmgr/netmgr
191+
URL: https://github.com/RimakiTaema/netmgr
189192
Source0: netmgr-%{version}.tar.gz
190193
191-
BuildRequires: gcc-c++ cmake ninja-build libjsoncpp-devel
192-
Requires: libjsoncpp
193-
194194
%description
195195
A comprehensive network management utility that provides
196196
unified interface management, routing, firewall configuration,
@@ -200,30 +200,32 @@ jobs:
200200
%setup -q
201201
202202
%build
203-
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
204-
cmake --build build --config Release
203+
# Binary is already built, just copy it
205204
206205
%install
207206
mkdir -p %{buildroot}%{_bindir}
208-
install -m 755 build/netmgr %{buildroot}%{_bindir}/netmgr
207+
install -m 755 netmgr %{buildroot}%{_bindir}/netmgr
209208
210209
%files
211210
%{_bindir}/netmgr
212211
%doc README.md
213212
%license LICENSE
214213
215214
%changelog
216-
* $(date +'%a %b %d %Y') NetMgr Team <team@netmgr.org> - %{version}-1
215+
* $CHANGELOG_DATE Rimaki <rimaki@rimakiproject.online> - %{version}-1
217216
- Initial release
218217
EOF
219218
219+
# Create source directory and copy files
220+
mkdir -p netmgr-${{ github.ref_name }}
221+
cp build/netmgr netmgr-${{ github.ref_name }}/
222+
cp README.md LICENSE netmgr-${{ github.ref_name }}/
223+
220224
# Create source tarball
221-
tar czf ~/rpmbuild/SOURCES/netmgr-${{ github.ref_name }}.tar.gz \
222-
--transform 's,^,netmgr-${{ github.ref_name }}/,' \
223-
--exclude='.git*' --exclude='build' .
225+
tar czf ~/rpmbuild/SOURCES/netmgr-${{ github.ref_name }}.tar.gz netmgr-${{ github.ref_name }}/
224226
225-
# Build RPM
226-
GITHUB_REF_NAME=${{ github.ref_name }} rpmbuild -ba ~/rpmbuild/SPECS/netmgr.spec
227+
# Build RPM (binary only since we already have the compiled binary)
228+
rpmbuild -bb ~/rpmbuild/SPECS/netmgr.spec
227229
cp ~/rpmbuild/RPMS/x86_64/netmgr-*.rpm ./
228230
229231
- name: Create AppImage (Linux x86_64 only)

0 commit comments

Comments
 (0)