diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml new file mode 100644 index 0000000..ca14da5 --- /dev/null +++ b/.github/workflows/appimage.yml @@ -0,0 +1,26 @@ +name: AppImage +on: + push: + tags: + - v* + +jobs: + AppImage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Build + run: | + ./dist/appimage/build.sh + echo "DANTON_APPIMAGE=danton-$(arch).AppImage" >> $GITHUB_ENV + echo "DANTON_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Upload + uses: AButler/upload-release-assets@v2.0 + with: + files: ${{ env.DANTON_APPIMAGE }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + release-tag: ${{ env.DANTON_VERSION }} diff --git a/README.md b/README.md index e0ab074..f59cae5 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ## Description DANTON is a __C99 library__ dedicated to the sampling of decaying taus from ultra high energy neutrinos interacting in the Earth. It can run in forward or -backward Monte-Carlo. it can also be configured to sample tau fluxes instead of +backward Monte Carlo. it can also be configured to sample tau fluxes instead of decay densities, or to sample transmitted neutrinos fluxes. The library is shipped with an __executable__, `danton` which takes a *data @@ -23,9 +23,22 @@ detailed topography can be provided from world wide elevation models, e.g. [SRTMGL1]: https://lpdaac.usgs.gov/dataset_discovery/measures/measures_products_table/srtmgl1_v003 ## Installation -DANTON requires a UNIX system, eg. Linux or OSX. The provided -[Makefile](Makefile) builds `libdanton` as a shared library as well as the -`danton` executable, e.g. as: +DANTON requires a UNIX system, eg. Linux or OSX. On Linux, the latest version of +the danton executable is available as an AppImage, from the +[releases](https://github.com/niess/danton/releases) assets, e.g. as: +```bash +# Fetch the danton AppImage from GitHub +wget https://github.com/niess/danton/releases/download/v0.3/danton-x86_64.AppImage + +# Make the downloaded binary executable +chmod u+x danton-x86_64.AppImage + +# Run the AppImage +./danton-x86_64.AppImage path/to/card.json +``` + +Alternatively, the provided [Makefile](Makefile) builds `libdanton` as a shared +library as well as the `danton` executable, e.g. as: ```bash # Fetch the source and deps from GitHub git clone --recursive https://github.com/niess/danton.git @@ -53,11 +66,11 @@ can also be found in the [examples/cards](examples/cards) folder. ### Root items ``` decay boolean If `true` the sampled taus are decayed. -events integer The number of Monte-Carlo events to run. +events integer The number of Monte Carlo events to run. longitudinal boolean If `true` the transverse transport is disabled. mode string The run mode, one of "backward", "forward" or "grammage". output-file string, null The output file name or `null` for `stdout`. -requested integer The requested number of valid Monte-Carlo events +requested integer The requested number of valid Monte Carlo events seed unsigned, null The simulation random seed. If null, then the seed is set from the OS entropy using /dev/urandom. ``` @@ -123,7 +136,7 @@ weight float The weight of the primary, i.e. the integra ``` append boolean If `true`, append to the output file. path string Path to the output file. -verbosity integer Verbosity level for recording Monte-Carlo steps. +verbosity integer Verbosity level for recording Monte Carlo steps. ``` ## License diff --git a/dist/appimage/AppRun b/dist/appimage/AppRun new file mode 100755 index 0000000..ac3c05a --- /dev/null +++ b/dist/appimage/AppRun @@ -0,0 +1,2 @@ +#! /bin/bash +DANTON_PREFIX=$APPDIR $APPDIR/bin/danton $* diff --git a/dist/linux.sh b/dist/appimage/build.sh similarity index 56% rename from dist/linux.sh rename to dist/appimage/build.sh index 27a7180..33783b2 100755 --- a/dist/linux.sh +++ b/dist/appimage/build.sh @@ -1,5 +1,8 @@ #! /bin/bash +# Script base directory. +basedir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + # Generate the binaries SCRIPT=$(cat <<-END echo "building danton with \$(gcc --version | head -n 1)" @@ -23,20 +26,13 @@ cp -rL include AppDir ./AppDir/bin/danton examples/cards/backward-tau-decays.json > /dev/null rm -f steps.json -# Bundle AppImage meta and entry point -cat << END > AppDir/danton.desktop -[Desktop Entry] -Type=Application -Name=danton -Exec=danton -Comment=Simulate the coupled transport of ultra high energy taus and neutrinos through the Earth, by Monte-Carlo -Icon=danton -Categories=Science; -Terminal=true -END +# Bundle AppImage meta and AppRun +cp ${basedir}/danton.desktop AppDir +cp ${basedir}/danton.png AppDir +cp ${basedir}/danton.appdata.xml AppDir +cp ${basedir}/AppRun AppDir -cat << END > AppDir/AppRun -#! /bin/bash -DANTON_PREFIX=\$APPDIR \$APPDIR/bin/danton \$* -END -chmod u+x AppDir/AppRun +# Build the AppImage +appimagetool=appimagetool-$(arch).AppImage +[ -e ${appimagetool} ] || wget https://github.com/AppImage/AppImageKit/releases/download/continuous/${appimagetool} && chmod u+x ${appimagetool} +./${appimagetool} AppDir diff --git a/dist/appimage/danton.appdata.xml b/dist/appimage/danton.appdata.xml new file mode 100644 index 0000000..8328317 --- /dev/null +++ b/dist/appimage/danton.appdata.xml @@ -0,0 +1,27 @@ + + + danton + MIT + LGL-3.0 + Danton + + Simulate the coupled transport of ultra high energy taus and neutrinos + through the Earth, by Monte-Carlo. + + +

Danton (DecAying Taus frOm Neutrinos) is an executable dedicated to + the sampling of decaying taus from ultra high energy neutrinos + interacting in the Earth. It can run in forward or backward + Monte Carlo. it can also be configured to sample tau fluxes instead + of decay densities, or to sample transmitted neutrinos fluxes. The + danton executable takes a data card in JSON format as argument. + Data cards syntax and examples are available from + https://github.com/niess/danton. +

+
+ danton.desktop + https://github.com/niess/danton + + danton + +
diff --git a/dist/appimage/danton.desktop b/dist/appimage/danton.desktop new file mode 100644 index 0000000..09a5aa1 --- /dev/null +++ b/dist/appimage/danton.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=danton +Exec=danton +Comment=Simulate the coupled transport of ultra high energy taus and neutrinos through the Earth, by Monte-Carlo +Icon=danton +Categories=Science; +Terminal=true diff --git a/dist/appimage/danton.png b/dist/appimage/danton.png new file mode 100644 index 0000000..942c473 Binary files /dev/null and b/dist/appimage/danton.png differ