@@ -105,21 +105,27 @@ jobs:
105105 fi
106106 # Move into the package dir
107107 cd "$PKG"
108+ # Set environment variables for dh_make to use correct maintainer info
109+ export DEBFULLNAME="OpenSVM"
110+ export DEBEMAIL="[email protected] " 108111 # Run dh_make using the temporary tarball - this avoids same-file error
109112 # dh_make will copy the temp tarball to the correct orig.tar.gz location
110113 dh_make -y -s -c apache -e [email protected] -f "../$TEMP_TARBALL" 114+ # Fix maintainer name in generated files
115+ sed -i 's/Maintainer: unknown/Maintainer: OpenSVM/' debian/control
116+ sed -i 's/ -- unknown/ -- OpenSVM/' debian/changelog
117+ # Build the .deb package from within the package directory where debian/ folder was created
118+ dpkg-buildpackage -us -uc
111119 # Move back to the working dir
112120 cd "$WORKDIR"
113121 # Clean up temporary tarball
114122 rm -f "$TEMP_TARBALL"
115- # Build the .deb package
116- dpkg-buildpackage -us -uc
117123
118124 - name : Upload Debian package
119125 uses : actions/upload-artifact@v4
120126 with :
121127 name : osvm-deb-package
122- path : ../osvm_ *.deb
128+ path : ./ *.deb
123129
124130 - name : Deploy to APT repository
125131 run : |
@@ -129,6 +135,167 @@ jobs:
129135 # Example: scp ../osvm_*.deb user@apt-repo:/path/to/repo/
130136 # Then update the repository index
131137
138+ deploy-termux :
139+ name : Deploy Termux Package
140+ needs : create-github-release
141+ runs-on : ubuntu-latest
142+ steps :
143+ - uses : actions/checkout@v4
144+
145+ - name : Download binary
146+ uses : actions/download-artifact@v4
147+ with :
148+ name : osvm-binary
149+ path : ./
150+
151+ - name : Make binary executable
152+ run : chmod +x ./osvm
153+
154+ - name : Create Termux package structure
155+ run : |
156+ VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
157+ PACKAGE_NAME="osvm"
158+ PACKAGE_DIR="${PACKAGE_NAME}_${VERSION}_aarch64"
159+
160+ # Create package directory structure
161+ mkdir -p "$PACKAGE_DIR"/data/data/com.termux/files/usr/bin
162+ mkdir -p "$PACKAGE_DIR"/control
163+
164+ # Copy binary
165+ cp ./osvm "$PACKAGE_DIR"/data/data/com.termux/files/usr/bin/
166+
167+ # Create control file
168+ cat > "$PACKAGE_DIR"/control/control << EOF
169+ Package: $PACKAGE_NAME
170+ Version: $VERSION
171+ Architecture: aarch64
172+ Maintainer: OpenSVM <[email protected] > 173+ Description: OpenSVM CLI tool for managing SVM nodes and deployments
174+ Homepage: https://github.com/${{ github.repository }}
175+ Section: utils
176+ Priority: optional
177+ Depends: rust
178+ EOF
179+
180+ # Create prerm script to handle cleanup
181+ cat > "$PACKAGE_DIR"/control/prerm << 'EOF'
182+ #!/bin/sh
183+ # Clean up any cached data
184+ rm -rf "$HOME/.osvm" 2>/dev/null || true
185+ EOF
186+ chmod +x "$PACKAGE_DIR"/control/prerm
187+
188+ # Create postinst script
189+ cat > "$PACKAGE_DIR"/control/postinst << 'EOF'
190+ #!/bin/sh
191+ # Ensure binary is executable
192+ chmod +x "$PREFIX/bin/osvm" 2>/dev/null || true
193+ echo "OpenSVM CLI installed successfully!"
194+ echo "Run 'osvm --help' to get started."
195+ EOF
196+ chmod +x "$PACKAGE_DIR"/control/postinst
197+
198+ # Create the .deb package for Termux
199+ dpkg-deb --build "$PACKAGE_DIR"
200+
201+ - name : Upload Termux package
202+ uses : actions/upload-artifact@v4
203+ with :
204+ name : osvm-termux-package
205+ path : ./*.deb
206+
207+ deploy-archlinux :
208+ name : Deploy ArchLinux Package
209+ needs : create-github-release
210+ runs-on : ubuntu-latest
211+ steps :
212+ - uses : actions/checkout@v4
213+
214+ - name : Create ArchLinux PKGBUILD
215+ run : |
216+ VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')
217+ SHA=$(curl -sL https://github.com/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz | shasum -a 256 | cut -d ' ' -f 1)
218+
219+ cat > PKGBUILD << EOF
220+ # Maintainer: OpenSVM <[email protected] > 221+ pkgname=osvm
222+ pkgver=${VERSION}
223+ pkgrel=1
224+ pkgdesc="OpenSVM CLI tool for managing SVM nodes and deployments"
225+ arch=('x86_64' 'aarch64')
226+ url="https://github.com/${{ github.repository }}"
227+ license=('MIT')
228+ depends=('glibc')
229+ makedepends=('rust' 'cargo' 'pkg-config' 'openssl' 'libudev0-shim')
230+ source=("\${pkgname}-\${pkgver}.tar.gz::https://github.com/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz")
231+ sha256sums=('${SHA}')
232+
233+ prepare() {
234+ cd "\${pkgname}-cli-\${pkgver}"
235+ }
236+
237+ build() {
238+ cd "\${pkgname}-cli-\${pkgver}"
239+ export RUSTUP_TOOLCHAIN=stable
240+ export CARGO_TARGET_DIR=target
241+ cargo build --release --locked
242+ }
243+
244+ check() {
245+ cd "\${pkgname}-cli-\${pkgver}"
246+ export RUSTUP_TOOLCHAIN=stable
247+ # Skip tests that require network access or specific hardware
248+ cargo test --release --locked || true
249+ }
250+
251+ package() {
252+ cd "\${pkgname}-cli-\${pkgver}"
253+ install -Dm0755 -t "\${pkgdir}/usr/bin/" "target/release/\${pkgname}"
254+ install -Dm0644 LICENSE "\${pkgdir}/usr/share/licenses/\${pkgname}/LICENSE"
255+ install -Dm0644 README.md "\${pkgdir}/usr/share/doc/\${pkgname}/README.md"
256+ }
257+ EOF
258+
259+ # Create .SRCINFO file for AUR
260+ cat > .SRCINFO << EOF
261+ pkgbase = osvm
262+ pkgdesc = OpenSVM CLI tool for managing SVM nodes and deployments
263+ pkgver = ${VERSION}
264+ pkgrel = 1
265+ url = https://github.com/${{ github.repository }}
266+ arch = x86_64
267+ arch = aarch64
268+ license = MIT
269+ makedepends = rust
270+ makedepends = cargo
271+ makedepends = pkg-config
272+ makedepends = openssl
273+ makedepends = libudev0-shim
274+ depends = glibc
275+ source = osvm-${VERSION}.tar.gz::https://github.com/${{ github.repository }}/archive/${{ github.ref_name }}.tar.gz
276+ sha256sums = ${SHA}
277+
278+ pkgname = osvm
279+ EOF
280+
281+ - name : Upload ArchLinux package files
282+ uses : actions/upload-artifact@v4
283+ with :
284+ name : osvm-archlinux-package
285+ path : |
286+ ./PKGBUILD
287+ ./.SRCINFO
288+
289+ - name : Submit to AUR (placeholder)
290+ run : |
291+ # This is a placeholder for the actual AUR submission
292+ # In a real scenario, you would clone the AUR repository and update the PKGBUILD
293+ echo "Submitting to AUR..."
294+ # Example steps:
295+ # git clone ssh://[email protected] /osvm.git 296+ # cp PKGBUILD .SRCINFO osvm/
297+ # cd osvm && git add . && git commit -m "Update to ${VERSION}" && git push
298+
132299 deploy-homebrew :
133300 name : Deploy to Homebrew
134301 needs : create-github-release
0 commit comments