mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
Merge pull request #356 from aikawayataro/ci-release
Automatic CI releases
This commit is contained in:
commit
c60751de9a
12 changed files with 324 additions and 139 deletions
|
@ -16,14 +16,15 @@ cd ../../
|
|||
|
||||
# Debain/Ubuntu package
|
||||
mkdir -p resources/deb/opt/sourcegit/
|
||||
mkdir -p resources/deb/usr/bin
|
||||
mkdir -p resources/deb/usr/share/applications
|
||||
mkdir -p resources/deb/usr/share/icons
|
||||
cp -f SourceGit/* resources/deb/opt/sourcegit/
|
||||
ln -sf ../../opt/sourcegit/sourcegit resources/deb/usr/bin
|
||||
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
|
||||
sed -i "2s/.*/Version: ${version}/g" resources/deb/DEBIAN/control
|
||||
dpkg-deb --build resources/deb ./sourcegit_${version}-1_amd64.deb
|
||||
dpkg-deb --root-owner-group --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}"
|
||||
|
|
70
build/ci/package.linux.sh
Executable file
70
build/ci/package.linux.sh
Executable file
|
@ -0,0 +1,70 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Provide the version as environment variable VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$RUNTIME" ]; then
|
||||
echo "Provide the runtime as environment variable RUNTIME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
arch=
|
||||
appimage_arch=
|
||||
target=
|
||||
case "$RUNTIME" in
|
||||
linux-x64)
|
||||
arch=amd64
|
||||
appimage_arch=x86_64
|
||||
target=x86_64;;
|
||||
linux-arm64)
|
||||
arch=arm64
|
||||
appimage_arch=arm_aarch64
|
||||
target=aarch64;;
|
||||
*)
|
||||
echo "Unknown runtime $RUNTIME"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
APPIMAGETOOL_URL=https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
||||
|
||||
cd build
|
||||
|
||||
if [ ! -f "appimagetool" ]; then
|
||||
curl -o appimagetool -L "$APPIMAGETOOL_URL"
|
||||
chmod +x appimagetool
|
||||
fi
|
||||
|
||||
rm -f SourceGit/*.dbg
|
||||
|
||||
mkdir -p SourceGit.AppDir/opt
|
||||
mkdir -p SourceGit.AppDir/usr/share/metainfo
|
||||
mkdir -p SourceGit.AppDir/usr/share/applications
|
||||
|
||||
cp -r SourceGit SourceGit.AppDir/opt/sourcegit
|
||||
desktop-file-install resources/_common/applications/sourcegit.desktop --dir SourceGit.AppDir/usr/share/applications \
|
||||
--set-icon com.sourcegit_scm.SourceGit --set-key=Exec --set-value=AppRun
|
||||
mv SourceGit.AppDir/usr/share/applications/{sourcegit,com.sourcegit_scm.SourceGit}.desktop
|
||||
cp resources/appimage/sourcegit.png SourceGit.AppDir/com.sourcegit_scm.SourceGit.png
|
||||
ln -rsf SourceGit.AppDir/opt/sourcegit/sourcegit SourceGit.AppDir/AppRun
|
||||
ln -rsf SourceGit.AppDir/usr/share/applications/com.sourcegit_scm.SourceGit.desktop SourceGit.AppDir
|
||||
cp resources/appimage/sourcegit.appdata.xml SourceGit.AppDir/usr/share/metainfo/com.sourcegit_scm.SourceGit.appdata.xml
|
||||
|
||||
ARCH="$appimage_arch" ./appimagetool -v SourceGit.AppDir "sourcegit-$VERSION.linux.$arch.AppImage"
|
||||
|
||||
mkdir -p resources/deb/opt/sourcegit/
|
||||
mkdir -p resources/deb/usr/bin
|
||||
mkdir -p resources/deb/usr/share/applications
|
||||
mkdir -p resources/deb/usr/share/icons
|
||||
cp -f SourceGit/* resources/deb/opt/sourcegit
|
||||
ln -sf ../../opt/sourcegit/sourcegit resources/deb/usr/bin
|
||||
cp -r resources/_common/applications resources/deb/usr/share
|
||||
cp -r resources/_common/icons resources/deb/usr/share
|
||||
sed -i -e "s/^Version:.*/Version: $VERSION/" -e "s/^Architecture:.*/Architecture: $arch/" resources/deb/DEBIAN/control
|
||||
dpkg-deb --root-owner-group --build resources/deb "sourcegit_$VERSION-1_$arch.deb"
|
||||
|
||||
rpmbuild -bb --target="$target" resources/rpm/SPECS/build.spec --define "_topdir $(pwd)/resources/rpm" --define "_version $VERSION"
|
||||
mv "resources/rpm/RPMS/$target/sourcegit-$VERSION-1.$target.rpm" ./
|
22
build/ci/package.osx-app.sh
Executable file
22
build/ci/package.osx-app.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Provide the version as environment variable VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$RUNTIME" ]; then
|
||||
echo "Provide the runtime as environment variable RUNTIME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd build
|
||||
|
||||
mkdir -p SourceGit.app/Contents/Resources
|
||||
mv SourceGit SourceGit.app/Contents/MacOS
|
||||
cp resources/app/App.icns SourceGit.app/Contents/Resources/App.icns
|
||||
sed "s/SOURCE_GIT_VERSION/$VERSION/g" resources/app/App.plist > SourceGit.app/Contents/Info.plist
|
||||
|
||||
zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit.app -x "*/*\.dsym/*"
|
19
build/ci/package.windows-portable.sh
Executable file
19
build/ci/package.windows-portable.sh
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$VERSION" ]; then
|
||||
echo "Provide the version as environment variable VERSION"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$RUNTIME" ]; then
|
||||
echo "Provide the runtime as environment variable RUNTIME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd build
|
||||
|
||||
rm -rf SourceGit/*.pdb
|
||||
|
||||
zip "sourcegit_$VERSION.$RUNTIME.zip" -r SourceGit
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>com.sourcegit-scm.SourceGit</id>
|
||||
<id>com.sourcegit_scm.SourceGit</id>
|
||||
<metadata_license>MIT</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
<name>SourceGit</name>
|
||||
|
@ -8,8 +8,9 @@
|
|||
<description>
|
||||
<p>Open-source GUI client for git users</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">com.sourcegit-scm.SourceGit.desktop</launchable>
|
||||
<url type="homepage">https://github.com/sourcegit-scm/sourcegit</url>
|
||||
<launchable type="desktop-id">com.sourcegit_scm.SourceGit.desktop</launchable>
|
||||
<provides>
|
||||
<id>com.sourcegit-scm.SourceGit.desktop</id>
|
||||
<id>com.sourcegit_scm.SourceGit.desktop</id>
|
||||
</provides>
|
||||
</component>
|
||||
</component>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Package: sourcegit
|
||||
Version: 8.18
|
||||
Version: 8.23
|
||||
Priority: optional
|
||||
Depends: libx11-6, libice6, libsm6
|
||||
Architecture: amd64
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!bin/sh
|
||||
|
||||
echo 'Create link on /usr/bin'
|
||||
ln -s /opt/sourcegit/sourcegit /usr/bin/sourcegit
|
||||
exit 0
|
|
@ -1,4 +0,0 @@
|
|||
#!bin/sh
|
||||
|
||||
rm -f /usr/bin/sourcegit
|
||||
exit 0
|
|
@ -14,24 +14,23 @@ Requires: libSM.so.6
|
|||
Open-source & Free Git Gui Client
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/opt/sourcegit
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/applications
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/share/icons
|
||||
cp -r ../../_common/applications $RPM_BUILD_ROOT/usr/share/
|
||||
cp -r ../../_common/icons $RPM_BUILD_ROOT/usr/share/
|
||||
cp -f ../../../SourceGit/* $RPM_BUILD_ROOT/opt/sourcegit/
|
||||
chmod 755 -R $RPM_BUILD_ROOT/opt/sourcegit
|
||||
chmod 755 $RPM_BUILD_ROOT/usr/share/applications/sourcegit.desktop
|
||||
mkdir -p %{buildroot}/opt/sourcegit
|
||||
mkdir -p %{buildroot}/%{_bindir}
|
||||
mkdir -p %{buildroot}/usr/share/applications
|
||||
mkdir -p %{buildroot}/usr/share/icons
|
||||
cp -f ../../../SourceGit/* %{buildroot}/opt/sourcegit/
|
||||
ln -sf ../../opt/sourcegit/sourcegit %{buildroot}/%{_bindir}
|
||||
cp -r ../../_common/applications %{buildroot}/%{_datadir}
|
||||
cp -r ../../_common/icons %{buildroot}/%{_datadir}
|
||||
chmod 755 -R %{buildroot}/opt/sourcegit
|
||||
chmod 755 %{buildroot}/%{_datadir}/applications/sourcegit.desktop
|
||||
|
||||
%files
|
||||
/opt/sourcegit
|
||||
/usr/share
|
||||
|
||||
%post
|
||||
ln -s /opt/sourcegit/sourcegit /usr/bin/sourcegit
|
||||
|
||||
%postun
|
||||
rm -f /usr/bin/sourcegit
|
||||
%dir /opt/sourcegit/
|
||||
/opt/sourcegit/*
|
||||
/usr/share/applications/sourcegit.desktop
|
||||
/usr/share/icons/*
|
||||
%{_bindir}/sourcegit
|
||||
|
||||
%changelog
|
||||
# skip
|
||||
# skip
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue