diff --git a/.github/workflows/TerminalNightly.yml b/.github/workflows/TerminalNightly.yml index 472230c9c..c39070b1b 100644 --- a/.github/workflows/TerminalNightly.yml +++ b/.github/workflows/TerminalNightly.yml @@ -4,7 +4,9 @@ on: push: branches: - master - + paths: + - 'Sources/Terminal/VERSION/**' + jobs: TerminalBuild: runs-on: ubuntu-latest @@ -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" diff --git a/.gitignore b/.gitignore index eb6ec2ee8..dde550a6e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,4 @@ TestResults /Sources/Tests/DotnetBenchmark/Properties/launchSettings.json **/.ionide/** Sources/msbuild.binlog +**/publish-output/** diff --git a/README.md b/README.md index a5ecf76cb..3a78c6415 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Sources/Terminal/AngouriMath.Terminal/pack-deb-linux-x64.sh b/Sources/Terminal/AngouriMath.Terminal/pack-deb-linux-x64.sh new file mode 100755 index 000000000..7e8e641a8 --- /dev/null +++ b/Sources/Terminal/AngouriMath.Terminal/pack-deb-linux-x64.sh @@ -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 \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 diff --git a/Sources/Terminal/AngouriMath.Terminal/publish-linux-x64.sh b/Sources/Terminal/AngouriMath.Terminal/publish-linux-x64.sh new file mode 100755 index 000000000..39c6f6632 --- /dev/null +++ b/Sources/Terminal/AngouriMath.Terminal/publish-linux-x64.sh @@ -0,0 +1,6 @@ +#!/bin/bash +dotnet publish \ +-r linux-x64 \ +-c release \ +-o ./publish-output/linux-x64 \ +--self-contained diff --git a/Sources/Terminal/AngouriMath.Terminal/publish-osx-x64.sh b/Sources/Terminal/AngouriMath.Terminal/publish-osx-x64.sh new file mode 100755 index 000000000..763bf103f --- /dev/null +++ b/Sources/Terminal/AngouriMath.Terminal/publish-osx-x64.sh @@ -0,0 +1,6 @@ +#!/bin/bash +dotnet publish \ +-r osx-x64 \ +-c release \ +-o ./publish-output/osx-x64 \ +--self-contained diff --git a/Sources/Terminal/AngouriMath.Terminal/publish-win-x64.sh b/Sources/Terminal/AngouriMath.Terminal/publish-win-x64.sh new file mode 100755 index 000000000..1596d0a61 --- /dev/null +++ b/Sources/Terminal/AngouriMath.Terminal/publish-win-x64.sh @@ -0,0 +1,6 @@ +#!/bin/bash +dotnet publish \ +-r win-x64 \ +-c release \ +-o ./publish-output/win-x64 \ +--self-contained diff --git a/Sources/Terminal/VERSION/VERSION b/Sources/Terminal/VERSION/VERSION new file mode 100644 index 000000000..367dd6246 --- /dev/null +++ b/Sources/Terminal/VERSION/VERSION @@ -0,0 +1 @@ +1.0.0.1-alpha