@@ -94,44 +94,33 @@ jobs:
9494 - name : Build Debian package
9595 run : |
9696 VERSION=${{ steps.version.outputs.VERSION }}
97+ # For deb, version must be numeric - fallback to 0.0.0 if not
98+ if ! echo "$VERSION" | grep -qE '^[0-9]'; then
99+ VERSION="0.0.0~${VERSION}"
100+ fi
97101 mkdir -p release/deb
98102
99- # Build the binary directly (simpler than dpkg-buildpackage with CGO deps)
100103 CGO_ENABLED=1 go build -ldflags="-s -w -X main.version=${VERSION}" -o kartoza-timesheet .
101104
102- # Create deb package structure
103105 PKG_DIR="release/deb/kartoza-timesheet-${VERSION}"
104106 mkdir -p "${PKG_DIR}/usr/bin"
105107 mkdir -p "${PKG_DIR}/usr/share/applications"
106108 mkdir -p "${PKG_DIR}/DEBIAN"
107109
108110 cp kartoza-timesheet "${PKG_DIR}/usr/bin/"
109111
110- # Desktop file
111- cat > "${PKG_DIR}/usr/share/applications/kartoza-timesheet.desktop" << 'DESKTOP'
112+ cat > "${PKG_DIR}/usr/share/applications/kartoza-timesheet.desktop" << 'EOF'
112113 [Desktop Entry]
113114 Name=Kartoza Timesheet
114115 Comment=Time tracking application for Kartoza
115116 Exec=kartoza-timesheet
116117 Terminal=false
117118 Type=Application
118119 Categories=Office;ProjectManagement;
119- DESKTOP
120+ EOF
120121
121- # Control file
122- cat > "${PKG_DIR}/DEBIAN/control" << CONTROL
123- Package: kartoza-timesheet
124- Version: ${VERSION}
125- Section: utils
126- Priority: optional
127- Architecture: amd64
128- Depends: libgl1, libx11-6, libxcursor1, libxrandr2, libxinerama1, libxi6
129- Maintainer: Tim Sutton <tim@kartoza.com>
130- Description: Kartoza Timesheet Application
131- A time tracking application with both TUI and GUI modes.
132- Features include project/task tracking, favourites, POW mode,
133- and integration with ERPNext timesheets.
134- CONTROL
122+ # Control file - no leading whitespace allowed
123+ printf 'Package: kartoza-timesheet\nVersion: %s\nSection: utils\nPriority: optional\nArchitecture: amd64\nDepends: libgl1, libx11-6, libxcursor1, libxrandr2, libxinerama1, libxi6\nMaintainer: Tim Sutton <tim@kartoza.com>\nDescription: Kartoza Timesheet Application\n A time tracking application with both TUI and GUI modes.\n Features include project/task tracking, favourites, POW mode,\n and integration with ERPNext timesheets.\n' "$VERSION" > "${PKG_DIR}/DEBIAN/control"
135124
136125 dpkg-deb --build "${PKG_DIR}"
137126 mv "${PKG_DIR}.deb" "release/deb/kartoza-timesheet_${VERSION}_amd64.deb"
@@ -183,32 +172,31 @@ jobs:
183172 - name : Build RPM package
184173 run : |
185174 VERSION=${{ steps.version.outputs.VERSION }}
175+ # RPM version must be numeric
176+ RPM_VERSION="$VERSION"
177+ if ! echo "$RPM_VERSION" | grep -qE '^[0-9]'; then
178+ RPM_VERSION="0.0.0"
179+ fi
186180
187- # Build binary
188- CGO_ENABLED=1 go build -ldflags="-s -w -X main.version=${VERSION}" -o kartoza-timesheet .
181+ # Build binary (disable VCS stamping - not available in container)
182+ CGO_ENABLED=1 GOFLAGS=-buildvcs=false go build -ldflags="-s -w -X main.version=${VERSION}" -o kartoza-timesheet .
189183
190- # Set up RPM build dirs
191184 mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
192-
193- # Copy binary to SOURCES
194185 cp kartoza-timesheet ~/rpmbuild/SOURCES/
195186
196- # Create spec file
187+ # Create spec file with no leading whitespace
197188 cat > ~/rpmbuild/SPECS/kartoza-timesheet.spec << SPEC
198189 Name: kartoza-timesheet
199- Version: ${VERSION }
190+ Version: ${RPM_VERSION }
200191 Release: 1%{?dist}
201192 Summary: Kartoza Timesheet Application
202193 License: MIT
203194 URL: https://github.com/kartoza/go-timesheets-go
204195 BuildArch: x86_64
205-
206196 Requires: mesa-libGL, libX11, libXcursor, libXrandr, libXinerama, libXi
207197
208198 %description
209199 A time tracking application with both TUI and GUI modes.
210- Features include project/task tracking, favourites, POW mode,
211- and integration with ERPNext timesheets.
212200
213201 %install
214202 mkdir -p %{buildroot}/usr/bin
@@ -332,9 +320,8 @@ jobs:
332320 Categories=Office;ProjectManagement;
333321 DESKTOP
334322
335- # Copy files to build dir
323+ # Copy binary to build dir (desktop file already in /tmp)
336324 cp kartoza-timesheet /tmp/
337- cp /tmp/com.kartoza.Timesheet.desktop /tmp/
338325
339326 cd /tmp
340327 flatpak-builder --user --force-clean --repo=repo build com.kartoza.Timesheet.yml
0 commit comments