Skip to content

Commit

Permalink
Deb simple (#593)
Browse files Browse the repository at this point in the history
Binary package with self-contained AngouriMath.Terminal is now published for Debian/Ubuntu in AngouriMathLab repo. The versions are now manual and lazily changed (instead of pushing a new one on every push)

Also info in README updated
  • Loading branch information
WhiteBlackGoose committed Sep 15, 2022
1 parent 93dd1ea commit dcc7a5b
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 25 deletions.
40 changes: 18 additions & 22 deletions .github/workflows/TerminalNightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- master

paths:
- 'Sources/Terminal/VERSION/**'

jobs:
TerminalBuild:
runs-on: ubuntu-latest
Expand All @@ -23,32 +25,26 @@ jobs:
- name: 'Build terminal for three OS'
run: |
cd Sources/Terminal/AngouriMath.Terminal
dotnet publish -c Release -r win-x64 -o win-x64-publish
dotnet publish -c Release -r linux-x64 -o linux-x64-publish
dotnet publish -c Release -r osx-x64 -o osx-x64-publish
- name: 'Create start script'
run: |
echo "dotnet AngouriMath.Terminal.dll" > ./Sources/Terminal/AngouriMath.Terminal/win-x64-publish/start.bat
echo "dotnet AngouriMath.Terminal.dll" > ./Sources/Terminal/AngouriMath.Terminal/linux-x64-publish/start.sh
echo "dotnet AngouriMath.Terminal.dll" > ./Sources/Terminal/AngouriMath.Terminal/osx-x64-publish/start.sh
./publish-osx-x64.sh
./publish-win-x64.sh
./publish-linux-x64.sh
./pack-deb-linux-x64.sh
- name: 'Pack'
run: |
zip -r terminal-win-x64.zip ./Sources/Terminal/AngouriMath.Terminal/win-x64-publish
zip -r terminal-linux-x64.zip ./Sources/Terminal/AngouriMath.Terminal/linux-x64-publish
zip -r terminal-osx-x64.zip ./Sources/Terminal/AngouriMath.Terminal/osx-x64-publish
zip -r terminal-win-x64.zip ./Sources/Terminal/AngouriMath.Terminal/publish-output/win-x64
zip -r terminal-linux-x64.zip ./Sources/Terminal/AngouriMath.Terminal/publish-output/linux-x64
zip -r terminal-osx-x64.zip ./Sources/Terminal/AngouriMath.Terminal/publish-output/osx-x64
- name: 'Release'
run: |
commithash=$(git rev-parse --short HEAD)
currtime=$(date +%s)
echo "commit hash is $commithash"
echo "time is $currtime"
name=1.0.0-terminal-master-$currtime-$commithash
echo "name is $name"
name=$(cat ./Sources/Terminal/VERSION/VERSION)
echo "Version: $name"
cp ./Sources/Terminal/AngouriMath.Terminal/publish-output/angourimath*.deb .
deb=$(ls | grep angourimath*.deb)

echo ${{ secrets.LAB_ACCESS_TOKEN }} > token.txt
gh auth login --with-token < token.txt
gh release create v$name 'terminal-win-x64.zip' 'terminal-linux-x64.zip' 'terminal-osx-x64.zip' -p -R asc-community/AngouriMathLab -t 'AngouriMath.Terminal auto-release'
gh release create v$name 'terminal-win-x64.zip' 'terminal-linux-x64.zip' 'terminal-osx-x64.zip' $deb -p -R asc-community/AngouriMathLab -t 'AngouriMath.Terminal' -n "Expand 'assets' and choose the one for your OS"

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ TestResults
/Sources/Tests/DotnetBenchmark/Properties/launchSettings.json
**/.ionide/**
Sources/msbuild.binlog
**/publish-output/**
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ As both a demonstration sample and a convenient tool, this repository includes
tool called AngouriMath.Terminal. It is a CLI-based program to interact with
AngouriMath (as opposed to API-based interaction, that is, consuming it as a lib).

[**[ Get nightly build ]**](https://github.com/asc-community/AngouriMathLab/releases)
If you only need this program, here is the instructions how to build and run it:
[**[ Download ]**](https://github.com/asc-community/AngouriMathLab/releases)

Or build from sources:
```
git clone https://github.com/asc-community/AngouriMath
cd AngouriMath/Sources/Terminal/AngouriMath.Terminal
Expand Down
40 changes: 40 additions & 0 deletions Sources/Terminal/AngouriMath.Terminal/pack-deb-linux-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
cd publish-output

version=$(cat ../../VERSION/VERSION)
filename="angourimath-terminal_${version}_amd64"

rm -r $filename
mkdir $filename
cd $filename

mkdir -p ./usr/local/bin/
mkdir -p ./usr/share/applications/
cp -r ../linux-x64 ./usr/local/bin
mv ./usr/local/bin/linux-x64 ./usr/local/bin/angourimath-terminal-data
echo 'cd /usr/local/bin/angourimath-terminal-data && ./AngouriMath.Terminal' > ./usr/local/bin/angourimath-terminal
chmod +x ./usr/local/bin/angourimath-terminal

mkdir DEBIAN && cd DEBIAN
touch control
printf "Package: angourimath-terminal\n" >> control
printf "Version: $version\n" >> control
printf "Architecture: amd64\n" >> control
printf "Maintainer: WhiteBlackGoose <[email protected]>\n" >> control
printf "Description: Terminal/CLI in F# for FOSS AngouriMath library\n" >> control

cd ..
printf "[Desktop Entry]\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Name=AngouriMath Terminal\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "GenericName=Symbolic calculator and computer algebra system\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Comment=Perform symbolic manipulations with expressions using AngouriMath and F#\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Exec=x-terminal-emulator -m -e /usr/local/bin/angourimath-terminal-data/AngouriMath.Terminal\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Icon=/usr/local/bin/angourimath-terminal-data/icon.png\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Type=Application\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Terminal=false\n" >> ./usr/share/applications/angourimath-terminal.desktop
printf "Categories=Office;Education;Development;\n" >> ./usr/share/applications/angourimath-terminal.desktop

cp ../../icon.png ./usr/local/bin/angourimath-terminal-data/

cd ..
dpkg-deb --build --root-owner-group $filename
6 changes: 6 additions & 0 deletions Sources/Terminal/AngouriMath.Terminal/publish-linux-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
dotnet publish \
-r linux-x64 \
-c release \
-o ./publish-output/linux-x64 \
--self-contained
6 changes: 6 additions & 0 deletions Sources/Terminal/AngouriMath.Terminal/publish-osx-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
dotnet publish \
-r osx-x64 \
-c release \
-o ./publish-output/osx-x64 \
--self-contained
6 changes: 6 additions & 0 deletions Sources/Terminal/AngouriMath.Terminal/publish-win-x64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
dotnet publish \
-r win-x64 \
-c release \
-o ./publish-output/win-x64 \
--self-contained
1 change: 1 addition & 0 deletions Sources/Terminal/VERSION/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0.1-alpha

0 comments on commit dcc7a5b

Please sign in to comment.