diff --git a/.github/actions/build_ubuntu_package/Dockerfile b/.github/actions/build_ubuntu_package/Dockerfile new file mode 100644 index 00000000000..7124308ad30 --- /dev/null +++ b/.github/actions/build_ubuntu_package/Dockerfile @@ -0,0 +1,7 @@ +FROM ubuntu:jammy + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update +RUN apt-get install -y dpkg-dev build-essential + +COPY entrypoint.sh /entrypoint.sh diff --git a/.github/actions/build_ubuntu_package/action.yml b/.github/actions/build_ubuntu_package/action.yml new file mode 100644 index 00000000000..c2370982161 --- /dev/null +++ b/.github/actions/build_ubuntu_package/action.yml @@ -0,0 +1,11 @@ +name: 'Ubuntu Package' +outputs: + package_file: + description: Name of package file generated +description: 'Build Ubuntu package' +runs: + using: "docker" + image: "Dockerfile" + entrypoint: "/entrypoint.sh" + + diff --git a/.github/actions/build_ubuntu_package/entrypoint.sh b/.github/actions/build_ubuntu_package/entrypoint.sh new file mode 100755 index 00000000000..f2ed2d72bdd --- /dev/null +++ b/.github/actions/build_ubuntu_package/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e -x -v +apt build-dep -y . && +dpkg-buildpackage -uc -us && +cp ../*.deb /github/workspace && +package_file=`ls /github/workspace/*.deb` +echo "::set-output name=package_file::${package_file}" + diff --git a/.github/actions/publish-ppa-package/Dockerfile b/.github/actions/publish-ppa-package/Dockerfile new file mode 100644 index 00000000000..beca92820b9 --- /dev/null +++ b/.github/actions/publish-ppa-package/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:jammy + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update && apt-get install -y \ + gpg debmake debhelper devscripts equivs \ + distro-info-data distro-info + +COPY entrypoint.sh /entrypoint.sh +COPY build.sh /build.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/.github/actions/publish-ppa-package/LICENSE b/.github/actions/publish-ppa-package/LICENSE new file mode 100644 index 00000000000..cc71c78ef86 --- /dev/null +++ b/.github/actions/publish-ppa-package/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Kevin Yue + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/.github/actions/publish-ppa-package/action.yml b/.github/actions/publish-ppa-package/action.yml new file mode 100644 index 00000000000..ba3d10f027e --- /dev/null +++ b/.github/actions/publish-ppa-package/action.yml @@ -0,0 +1,29 @@ +name: 'publish-ppa-package' +description: 'Publish a PPA package' +branding: + color: orange + icon: package +inputs: + repository: + description: 'The PPA respository, e.g. ppa:yuezk/globalprotect-openconnect' + required: true + gpg_private_key: + description: 'GPG private key exported as an ASCII armored version or its base64 encoding' + required: true + gpg_passphrase: + description: 'Passphrase of the GPG private key' + required: false + pkgdir: + description: 'The package directory which contains the debian folder' + required: true + series: + description: 'The series to which the package will be published, separated by space. e.g., "bionic focal"' + required: false + is_native: + description: 'Indicates whether it is a native debian package or not' + required: false + default: '' + +runs: + using: docker + image: Dockerfile \ No newline at end of file diff --git a/.github/actions/publish-ppa-package/build.sh b/.github/actions/publish-ppa-package/build.sh new file mode 100755 index 00000000000..a0590d01e04 --- /dev/null +++ b/.github/actions/publish-ppa-package/build.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +set -o errexit -o pipefail -o nounset + +REPOSITORY=$INPUT_REPOSITORY +GPG_PRIVATE_KEY="$INPUT_GPG_PRIVATE_KEY" +GPG_PASSPHRASE=$INPUT_GPG_PASSPHRASE +PKGDIR=$INPUT_PKGDIR +IS_NATIVE=$INPUT_IS_NATIVE +SERIES=$INPUT_SERIES + +assert_non_empty() { + name=$1 + value=$2 + if [[ -z "$value" ]]; then + echo "::error::Invalid Value: $name is empty." >&2 + exit 1 + fi +} + +assert_non_empty inputs.repository "$REPOSITORY" +assert_non_empty inputs.gpg_private_key "$GPG_PRIVATE_KEY" +assert_non_empty inputs.gpg_passphrase "$GPG_PASSPHRASE" +assert_non_empty inputs.pkgdir "$PKGDIR" + +if [[ -z "$SERIES" ]]; then + SERIES=$(distro-info --supported) +fi + +echo "::group::Importing GPG private key..." +GPG_KEY_ID=$(echo "$GPG_PRIVATE_KEY" | gpg --import-options show-only --import | sed -n '2s/^\s*//p') +echo $GPG_KEY_ID +echo "$GPG_PRIVATE_KEY" | gpg --batch --passphrase "$GPG_PASSPHRASE" --import +echo "::endgroup::" + +for s in $SERIES; do + ubuntu_version=$(distro-info --series $s -r) + version="${ubuntu_version:0:5}" + + echo "::group::Building deb for: $version ($s)" + + cd $PKGDIR + if [[ -z "$IS_NATIVE" ]]; then + format_file="debian/source/format" + if [[ ! -f "$format_file" ]] || grep -q "native" "$format_file"; then + IS_NATIVE="true" + fi + fi + + if [[ "$IS_NATIVE" == "true" ]]; then + echo "Making native package..." + debmake -n -y + else + echo "Making non-native package..." + debmake -y + fi + + mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control + + sed -i"" -re "s/\s\w+;/ $s;/" -re "s/\((.+)-.+\)/(\1-ppa1~ubuntu${version})/" debian/changelog + + if [[ "$IS_NATIVE" == "true" ]]; then + echo "y" | debuild -S -sa \ + -k"$GPG_KEY_ID" \ + -p"gpg --batch --passphrase "$GPG_PASSPHRASE" --pinentry-mode loopback" + else + debuild -S -sa \ + -k"$GPG_KEY_ID" \ + -p"gpg --batch --passphrase "$GPG_PASSPHRASE" --pinentry-mode loopback" + fi + dput $REPOSITORY ../*.changes + + rm -rf ../*.{changes,build,buildinfo,deb,ddeb,dsc} + echo "::endgroup::" +done \ No newline at end of file diff --git a/.github/actions/publish-ppa-package/entrypoint.sh b/.github/actions/publish-ppa-package/entrypoint.sh new file mode 100755 index 00000000000..db38a13975d --- /dev/null +++ b/.github/actions/publish-ppa-package/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash -l + +set -o errexit -o pipefail -o nounset + +/build.sh \ No newline at end of file diff --git a/.github/actions/test_ubuntu_package/Dockerfile b/.github/actions/test_ubuntu_package/Dockerfile new file mode 100644 index 00000000000..9af21572675 --- /dev/null +++ b/.github/actions/test_ubuntu_package/Dockerfile @@ -0,0 +1,6 @@ +FROM ubuntu:focal + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update && apt-get install -y python3 + +COPY entrypoint.sh /entrypoint.sh diff --git a/.github/actions/test_ubuntu_package/action.yml b/.github/actions/test_ubuntu_package/action.yml new file mode 100644 index 00000000000..537540e81f1 --- /dev/null +++ b/.github/actions/test_ubuntu_package/action.yml @@ -0,0 +1,13 @@ +name: 'Test Ubuntu Package' +description: 'Test Ubuntu package' +inputs: + package_file: + description: Name of package file to install and test + required: true +runs: + using: "docker" + image: "Dockerfile" + entrypoint: "/entrypoint.sh" + args: + - ${{ inputs.package_file }} + diff --git a/.github/actions/test_ubuntu_package/entrypoint.sh b/.github/actions/test_ubuntu_package/entrypoint.sh new file mode 100755 index 00000000000..2ab1532b4b4 --- /dev/null +++ b/.github/actions/test_ubuntu_package/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +apt-get install -y $1 +echo $1 +ls -la /github/workspace +python3 -c 'import espressomd; system=espressomd.System(box_l=[1,1,1])' diff --git a/.github/workflows/push_pull.yml b/.github/workflows/mac_test.yml similarity index 99% rename from .github/workflows/push_pull.yml rename to .github/workflows/mac_test.yml index ad816ba714a..cb629553941 100644 --- a/.github/workflows/push_pull.yml +++ b/.github/workflows/mac_test.yml @@ -55,3 +55,4 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} title: Scheduled CI job has failed body: ${{ env.job_link }} + diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml new file mode 100644 index 00000000000..833fd7beb1d --- /dev/null +++ b/.github/workflows/packaging.yml @@ -0,0 +1,40 @@ +name: Build packages + +on: + push: + pull_request: + schedule: + - cron: '0 3 * * *' + +jobs: + ubuntupackage: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@main + + - name: Build + run: | + mkdir -p ./artifacts/deb-build + git archive --prefix=espresso-espresso-4.2/ -o ./artifacts/espresso-4.2.tar.gz HEAD + cd ./artifacts + cp *.tar.gz deb-build && cd deb-build + tar xf *.tar.gz + # - name: Build package + # id: build + # uses: ./.github/actions/build_ubuntu_package + # - name: Test package + # uses: ./.github/actions/test_ubuntu_package + # with: + ## package_file: ${{steps.build.outputs.package_file }} + + - name: Publish PPA + uses: ./.github/actions/publish-ppa-package + with: + repository: 'ppa:bishwash369/espressoppa' + gpg_private_key: ${{ secrets.ESPRESSO_PPA_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.ESPRESSO_PPA_PASSPHRASE }} + pkgdir: '${{ github.workspace }}/artifacts/deb-build/espresso*/' + + + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000000..9fe0358cf4e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,12 @@ +espresso (4.2.1-rc1) unstable; urgency=medium + + * Initial release + + -- Bishwash Krishna Parajuli Fri, 03 Feb 2023 18:57:28 +0100 + + +espresso (4.1.5~rc1) unstable; urgency=medium + + * Initial release + + -- Evangelos Ribeiro Tzaras Sun, 28 Mar 2021 17:15:36 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000000..8756fbeec49 --- /dev/null +++ b/debian/control @@ -0,0 +1,60 @@ +Source: espresso +Section: science +Priority: optional +Maintainer: Espresso Maintainers +Build-Depends: + cmake (>= 3.18), + cython3, + debhelper-compat (= 12), + fftw3-dev, + libblas-dev, + libboost-dev, + libboost-filesystem-dev, + libboost-mpi-dev, + libboost-serialization-dev, + libboost-test-dev, + libfftw3-dev, + libgsl-dev, + libhdf5-dev, + libhdf5-openmpi-dev, + libhdf5-openmpi-dev, + liblapack-dev, + python3-dev, + libpython3-dev, + openmpi-common, + python3, + python3-h5py, + python3-numpy, + python3-scipy +Rules-Requires-Root: no +Standards-Version: 4.5.0 +Vcs-Browser: https://github.com/espressomd/espresso +Vcs-Git: https://github.com/espressomd/espresso.git +Homepage: https://espressomd.org + +Package: espresso +Architecture: any +Depends: + python3, + python3-h5py, + python3-numpy, + python3-opengl, + python3-scipy, + python3-vtk7, + libboost-filesystem1.71.0, + libboost-mpi1.71.0, + libboost-serialization1.71.0, + libfftw3-3, + libgsl23, + libhdf5-openmpi-103, + libopenblas0-pthread, + openmpi-bin, + libopenmpi3, + libstdc++6, + ${misc:Depends}, +Description: Molecular dynamics simulation package + ESPResSo is a highly versatile software package for performing + and analyzing scientific Molecular Dynamics many-particle + simulations of coarse-grained atomistic or bead-spring models + as they are used in soft matter research in physics, chemistry + and molecular biology. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000000..18411b274fc --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: espresso +Upstream-Contact: Espresso mailing list +Source: https://github.com/espressomd/espresso.git +License: GPL-3 + +Files: * +Copyright: 2010-2021 The ESPResSo project + 2002-2010 Max-Planck-Institute for Polymer Research, Theory Group +License: GPL-3 + + +License: GPL-3+ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 3 of the License, or (at your option) any later + version. + . + This program 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. + . + 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'. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 00000000000..494f58dcfaf --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,10 @@ +[DEFAULT] +debian-branch = python +debian-tag = v%(version)s +debian-tag-msg = %(pkg)s v%(version)s + +[tag] +sign-tags = true + +[dch] +multimaint-merge = true diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000000..6678ea8d20e --- /dev/null +++ b/debian/rules @@ -0,0 +1,10 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS= hardening=+all + +%: + dh $@ + + +override_dh_auto_test: + true diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000000..89ae9db8f88 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debian/watch b/debian/watch new file mode 100644 index 00000000000..44e6b965d2a --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=4 +opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/espresso-$1\.tar\.gz/ \ + https://github.com/espressomd/espresso/tags .*/v?(\d\S+)\.tar\.gz