Skip to content

Commit

Permalink
Merge pull request #149 from lacmus-foundation/refact
Browse files Browse the repository at this point in the history
v0.7.0
  • Loading branch information
gosha20777 authored Aug 19, 2022
2 parents 78badd9 + 6cd90cb commit 91e8933
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 4 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
name: Make Release

on:
push:
tags:
- 'v*.*.*'

jobs:
linux-artefact:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet_version: ['6.0.x']
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v1
- run: cd src && dotnet build --configuration Release
- name: Create artifact linux
run: |
dotnet tool install --global dotnet-rpm
dotnet tool install --global dotnet-deb
dotnet tool install --global dotnet-tarball
echo "building packeges"
dotnet restore src/LacmusApp.sln
mkdir -p bin/linux
cd src/LacmusApp.Avalonia
dotnet rpm install
dotnet deb install
dotnet tarball install
dotnet rpm --framework net6.0 -c Release --runtime="linux-x64" -o ../../bin/linux LacmusApp.Avalonia.csproj
dotnet deb --framework net6.0 -c Release --runtime="linux-x64" -o ../../bin/linux LacmusApp.Avalonia.csproj
dotnet tarball --framework net6.0 -c Release --runtime="linux-x64" -o ../../bin/linux LacmusApp.Avalonia.csproj
shell: bash
- uses: actions/upload-artifact@v3
with:
name: artifact-linux-deb
path: |
./bin/linux/*.deb
- uses: actions/upload-artifact@v3
with:
name: artifact-linux-rpm
path: |
./bin/linux/*.rpm
- uses: actions/upload-artifact@v3
with:
name: artifact-linux-tar
path: |
./bin/linux/*.tar.gz
windows-artefact:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet_version: ['6.0.x']
os:
- windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v1
- name: Create artifact windows
run: |
dotnet tool install --global dotnet-zip
echo "building packeges"
dotnet restore src/LacmusApp.sln
mkdir -p bin/windows
mkdir -p bin/windows/app
mkdir -p bin/windows/installer
cd src/LacmusApp.Avalonia
dotnet zip install
dotnet zip --framework net6.0 -c Release --runtime="win-x64" -o ../../bin/windows LacmusApp.Avalonia.csproj
dotnet publish --framework net6.0 -c Release --runtime="win-x64" -o ../../bin/windows/app LacmusApp.Avalonia.csproj
cd ../../
curl -L --output bin/windows/installer/temp.zip https://github.com/lacmus-foundation/inno-setup-gihtub-action/releases/download/v.1.0.0/innoSetupCli.zip
unzip bin/windows/installer/temp.zip -d bin/windows/installer
./bin/windows/installer/ISCC.exe packages/windows/script.iss
shell: bash
- uses: actions/upload-artifact@v3
with:
name: artifact-windows-zip
path: |
./bin/windows/*.zip
- uses: actions/upload-artifact@v3
with:
name: artifact-windows-setup
path: |
./bin/windows/lacmusSetup.exe
osx-artefact:
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet_version: ['6.0.x']
os:
- osx-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v1
- name: Create artifact osx
run: |
bash packages/osx/build-osx.sh
dotnet tool install --global dotnet-tarball
echo "building packeges"
dotnet restore src/LacmusApp.sln
cd src/LacmusApp.Avalonia
dotnet tarball install
dotnet tarball --framework net6.0 -c Release --runtime="osx-x64" -o ../../bin/osx LacmusApp.Avalonia.csproj
shell: bash
- uses: actions/upload-artifact@v3
with:
name: artifact-osx-tar
path: |
./bin/osx/*.tar.gz
- uses: actions/upload-artifact@v3
with:
name: artifact-osx-app
path: |
./bin/osx/*.zip
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Packaging.Targets">
<Version>0.1.220-*</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
28 changes: 28 additions & 0 deletions packages/linux/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Lacmus Application
Upstream-Contact: Lacmus Foundation <[email protected]>
Source: https://github.com/lacmus-foundation

Files: *
Copyright: Copyright 2020 Lacmus Foundation <[email protected]>
License: GPL-3

License: GPL-3
Indicator Weather is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License version 3 as published by the Free Software Foundation.
.
Indicator Weather is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details. http://www.gnu.org/licenses/
.
You should have received a copy of the GNU General Public
License along with this package; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA
.
On Debian systems, the full text of the GNU General Public
License version 3 can be found in the file
`/usr/share/common-licenses/GPL-3'.
15 changes: 15 additions & 0 deletions packages/linux/lacmus.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Desktop Entry]
Encoding=UTF-8
Name=Lacmus
StartupWMClass=Lacmus
Comment=Lacmus Desktop Application
GenericName=Program for searching and saving people
Name[ru]=Lacmus
GenericName[ru]=Приложение Lacmus
Comment[ru]=Программа для поиска и спасения людей
Exec=/usr/share/LacmusApp.Avalonia/LacmusApp.Avalonia
Icon=/usr/share/pixmaps/lacmus.png
Terminal=true
Type=Application
Categories=ImageProcessing;Photography;Utility;
MimeType=image/jpeg;image/png;image/xml;image/bmp;text/xml;
Binary file added packages/linux/lacmus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions packages/osx/LacmusApp.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key><true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key><true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key><true/>
<key>com.apple.security.cs.disable-library-validation</key><true/>
<key>com.apple.security.automation.apple-events</key><true/>
<key>com.apple.security.get-task-allow</key><true/>
</dict>
</plist>
Binary file added packages/osx/LacmusApp.icns
Binary file not shown.
86 changes: 86 additions & 0 deletions packages/osx/build-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
APP_NAME="LacmusApp.Avalonia"
RID_LIST=("osx-x64")
PUB_PLATFORM_LIST=("osx-x64")
CONFIG="Release"
CERT_NAME="" # Name of certification to sign the application

echo "********** Start building $APP_NAME **********"

# Get application version
VERSION="0.7.0"
if [ "$?" != "0" ]; then
echo "Unable to get version of $APP_NAME"
exit
fi
echo "Version: $VERSION"

# Create output directory
mkdir -p bin/osx
cd src

# Build packages
for i in "${!RID_LIST[@]}"; do
RID=${RID_LIST[$i]}
PUB_PLATFORM=${PUB_PLATFORM_LIST[$i]}

echo " "
echo "[$PUB_PLATFORM ($RID)]"
echo " "

# clean
rm -rf ./LacmusApp.Avalonia/bin/
dotnet clean
dotnet restore
if [ "$?" != "0" ]; then
exit
fi

# build
dotnet msbuild LacmusApp.Avalonia -t:BundleApp -property:Configuration=$CONFIG -p:SelfContained=true -p:PublishSingleFile=false -p:PublishTrimmed=true -p:RuntimeIdentifier=$RID
if [ "$?" != "0" ]; then
exit
fi

# create output directory
if [[ -d "../bin/osx/$PUB_PLATFORM" ]]; then
rm -r "../bin/osx/$PUB_PLATFORM"
fi
echo "Create directory '../bin/osx/$PUB_PLATFORM'"
mkdir "../bin/osx/$PUB_PLATFORM"
if [ "$?" != "0" ]; then
exit
fi

# copy .app directory to output directoty
echo "Creating app bundle..."
mv ./LacmusApp.Avalonia/bin/$CONFIG/net6.0/$RID/publish/Lacmus.app ../bin/osx/$PUB_PLATFORM/Lacmus.app
if [ "$?" != "0" ]; then
exit
fi

# copy application icon and remove unnecessary files
cp ../packages/osx/LacmusApp.icns ../bin/osx/$PUB_PLATFORM/Lacmus.app/Contents/Resources/LacmusApp.icns
if [ "$?" != "0" ]; then
exit
fi

# sign application
#find "../bin/osx/$PUB_PLATFORM/Lacmus.app/Contents/MacOS/" | while read FILE_NAME; do
# if [[ -f $FILE_NAME ]]; then
# if [[ "$FILE_NAME" != "../bin/osx/$PUB_PLATFORM/Lacmus.app/Contents/MacOS//$APP_NAME" ]]; then
# echo "Signing $FILE_NAME"
# codesign -f -o runtime --timestamp --entitlements "../packages/osx/LacmusApp.entitlements" -s "$CERT_NAME" "$FILE_NAME"
# if [ "$?" != "0" ]; then
# exit
# fi
# fi
# fi
#done
#codesign -f -o runtime --timestamp --entitlements "../packages/osx/LacmusApp.entitlements" -s "$CERT_NAME" "../bin/osx/$PUB_PLATFORM/Lacmus.app/Contents/MacOS/$APP_NAME"
#codesign -f -o runtime --timestamp --entitlements "../packages/osx/LacmusApp.entitlements" -s "$CERT_NAME" "../bin/osx/$PUB_PLATFORM/Lacmus.app"
#
# zip .app directory
ditto -c -k --sequesterRsrc --keepParent "../bin/osx/$PUB_PLATFORM/Lacmus.app" "../bin/osx/LacmusApp.Avalonia-$VERSION-$PUB_PLATFORM.zip"
rm -rf "../bin/osx/$PUB_PLATFORM/Lacmus.app"

done
49 changes: 49 additions & 0 deletions packages/windows/script.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#define MyAppName "Lacmus Application"
#define MyAppVersion "0.7.0"
#define MyAppPublisher "Lacmus Foundation"
#define MyAppURL "https://lacmus.ml/"
#define MyAppExeName "LacmusApp.Avalonia.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{D11C6204-2C3F-4FA0-ABE6-DC08D507CF2B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\Lacmus
DisableDirPage=yes
DisableProgramGroupPage=yes
LicenseFile=..\..\LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=..\..\bin\windows
OutputBaseFilename=lacmusSetup
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\..\bin\windows\app\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\bin\windows\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
40 changes: 38 additions & 2 deletions src/LacmusApp.Avalonia/LacmusApp.Avalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,33 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>linux-x64;win-x64;osx-x64</RuntimeIdentifiers>
<Company>Lacmus Foundation</Company>
<AssemblyVersion>0.6.0</AssemblyVersion>
<FileVersion>0.6.0</FileVersion>
<AssemblyVersion>0.7.0</AssemblyVersion>
<FileVersion>0.7.0</FileVersion>
<Version>0.7.0</Version>
<Authors>gosha20777</Authors>
<Copyright>Copyright (c) Lacmus Foundation 2022</Copyright>
<Description>Lacmus help to find lost people in Search and Rescue operations. Lacmus is a cross-platform application which use computer vision and neural networks and written with C#, .NET Core, ReactiveUI and Avalonia.</Description>
<PackageId>LacmusApp.Avalonia</PackageId>
<Title>Lacmus Application</Title>
<PackageProjectUrl>https://lacmus.ml/</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/lacmus-foundation/lacmus-app/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/lacmus-foundation/lacmus-app</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>lacmus</PackageTags>
</PropertyGroup>
<PropertyGroup>
<CFBundleName>Lacmus</CFBundleName> <!-- Also defines .app file name -->
<CFBundleDisplayName>Lacmus</CFBundleDisplayName>
<CFBundleIdentifier>com.example</CFBundleIdentifier>
<CFBundleVersion>0.7.0</CFBundleVersion>
<CFBundleShortVersionString>0.7.0</CFBundleShortVersionString>
<CFBundlePackageType>APPL</CFBundlePackageType>
<CFBundleExecutable>LacmusApp.Avalonia</CFBundleExecutable>
<CFBundleIconFile>..\..\packages\osx\LacmusApp.icns</CFBundleIconFile> <!-- Will be copied from output directory -->
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand All @@ -31,6 +55,7 @@
<PackageReference Include="Avalonia.Native" Version="0.10.17" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.17" />
<PackageReference Include="Citrus.Avalonia" Version="1.6.1" />
<PackageReference Include="Dotnet.Bundle" Version="0.9.13" />
<PackageReference Include="Flurl" Version="3.0.6" />
<PackageReference Include="LacmusPlugin" Version="2.0.3" />
<PackageReference Include="MessageBox.Avalonia" Version="2.0.2" />
Expand Down Expand Up @@ -58,4 +83,15 @@
<ItemGroup>
<ProjectReference Include="..\LacmusApp\LacmusApp.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\packages\linux\lacmus.desktop" CopyToPublishDirectory="Always">
<LinuxPath>/usr/share/applications/lacmus.desktop</LinuxPath>
</Content>
<Content Include="..\..\packages\linux\lacmus.png" CopyToPublishDirectory="Always">
<LinuxPath>/usr/share/pixmaps/lacmus.png</LinuxPath>
</Content>
<Content Include="..\..\packages\linux\copyright" CopyToPublishDirectory="Always">
<LinuxPath>/usr/share/doc/lacmus/copyright</LinuxPath>
</Content>
</ItemGroup>
</Project>
Loading

0 comments on commit 91e8933

Please sign in to comment.