2024-03-18 20:24:08 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2024-04-16 20:00:48 -07:00
|
|
|
version=`cat ../VERSION`
|
2024-04-16 02:29:36 -07:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm -rf SourceGit *.tar.gz resources/deb/opt *.deb *.rpm
|
|
|
|
|
|
|
|
# Compile
|
2024-04-02 05:00:33 -07:00
|
|
|
dotnet publish ../src/SourceGit.csproj -c Release -r linux-x64 -o SourceGit -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link --self-contained
|
2024-04-16 02:29:36 -07:00
|
|
|
mv SourceGit/SourceGit SourceGit/sourcegit
|
2024-04-30 06:58:09 -07:00
|
|
|
cp resources/app/App.icns SourceGit/sourcegit.icns
|
2024-04-16 02:29:36 -07:00
|
|
|
rm -f SourceGit/*.dbg
|
|
|
|
|
|
|
|
# General Linux archive
|
|
|
|
tar -zcvf sourcegit_${version}.linux-x64.tar.gz SourceGit
|
2024-04-30 06:58:09 -07:00
|
|
|
rm -f SourceGit/sourcegit.icns
|
2024-04-16 02:29:36 -07:00
|
|
|
|
|
|
|
# Debain/Ubuntu package
|
|
|
|
mkdir -p resources/deb/opt/sourcegit/
|
|
|
|
mkdir -p resources/deb/usr/share/applications
|
|
|
|
mkdir -p resources/deb/usr/share/icons
|
|
|
|
cp -f SourceGit/* resources/deb/opt/sourcegit/
|
2024-06-27 20:21:58 -07:00
|
|
|
cp -r resources/_common/applications resources/deb/usr/share/
|
|
|
|
cp -r resources/_common/icons resources/deb/usr/share/
|
|
|
|
chmod +x -R resources/deb/opt/sourcegit
|
2024-04-16 02:29:36 -07:00
|
|
|
sed -i "2s/.*/Version: ${version}/g" resources/deb/DEBIAN/control
|
|
|
|
dpkg-deb --build resources/deb ./sourcegit_${version}-1_amd64.deb
|
|
|
|
|
|
|
|
# Redhat/CentOS/Fedora package
|
|
|
|
rpmbuild -bb --target=x86_64 resources/rpm/SPECS/build.spec --define "_topdir `pwd`/resources/rpm" --define "_version ${version}"
|
|
|
|
mv resources/rpm/RPMS/x86_64/sourcegit-${version}-1.x86_64.rpm .
|
|
|
|
|
2024-04-16 20:00:48 -07:00
|
|
|
rm -rf SourceGit
|