Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building PPA Package for ESPResSo #4664

Open
wants to merge 37 commits into
base: python
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b09513d
Initial debianization
fortysixandtwo Mar 28, 2021
94b0398
Debian: relax version dependency for debhelper-compat
RudolfWeeber Apr 20, 2021
0f5f1fd
Debian: Github action to build package
RudolfWeeber Apr 20, 2021
8369e77
Debian: Add package build to workflow
RudolfWeeber Apr 20, 2021
46b3901
Debian: Build script
RudolfWeeber Apr 20, 2021
db53c69
Debian: Entrypoint
RudolfWeeber Apr 20, 2021
c8ec4cc
Debian: Update package cache
RudolfWeeber Apr 20, 2021
97e15bc
Debian: apt build-dep non-interactive
RudolfWeeber Apr 20, 2021
cf1fde4
Debian: non-interactive
RudolfWeeber Apr 20, 2021
84db330
Debian: Dependencies
RudolfWeeber Apr 20, 2021
c2f8051
Debian: Noninteractive
RudolfWeeber Apr 20, 2021
6ebf585
Typo
RudolfWeeber Apr 20, 2021
1f2afea
iDebian: compat
RudolfWeeber Apr 20, 2021
1dea2f1
Debian: Build dpendencies
RudolfWeeber Apr 20, 2021
8a07c1e
Debian: ls created image
RudolfWeeber Apr 20, 2021
ddeed7c
Debian: dependencies
RudolfWeeber Apr 20, 2021
73ab55a
Debian: Test package
RudolfWeeber Apr 21, 2021
1320e24
fix a missing python3 installation and add get
bishwash369 Feb 2, 2023
293b493
debug and display github/workflow
bishwash369 Feb 2, 2023
2e51a33
ubuntu version update
bishwash369 Feb 2, 2023
a1665f1
added ppa publish settings on workflow
bishwash369 Feb 2, 2023
27b955f
comment build and test settings in workflow
bishwash369 Feb 2, 2023
9a3805e
name: Publish PPAw
bishwash369 Feb 2, 2023
dca1adf
added yml file for ppa package creation
bishwash369 Feb 3, 2023
08a2a12
changes in packaging yml for pkgdir
bishwash369 Feb 3, 2023
dbe4ac8
latest package to publish ppa
bishwash369 Feb 3, 2023
c7267e7
created a new build run to create an artifact
bishwash369 Feb 3, 2023
068797a
replaced git-archive-all with git archive
bishwash369 Feb 3, 2023
acb876c
importted publish-ppa-package to make changes to it
bishwash369 Feb 3, 2023
c16aa80
modified settings in the ppa-package
bishwash369 Feb 3, 2023
3f547a3
modified .sh files with git update-index command
bishwash369 Feb 3, 2023
1e4bf48
work in progress- hardcoded package version
bishwash369 Feb 3, 2023
13b0774
change log file edited
bishwash369 Feb 3, 2023
46041c0
modification of control: cmake version, and version updated in changelog
bishwash369 Feb 3, 2023
e0dc48e
modification of control file for versions of libraries
bishwash369 Feb 3, 2023
9ade7d3
version change for dbhelper-compat in control file
bishwash369 Feb 3, 2023
9d90c68
test commit for actions
bishwash369 Feb 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/build_ubuntu_package/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions .github/actions/build_ubuntu_package/action.yml
Original file line number Diff line number Diff line change
@@ -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"


8 changes: 8 additions & 0 deletions .github/actions/build_ubuntu_package/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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}"

12 changes: 12 additions & 0 deletions .github/actions/publish-ppa-package/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
21 changes: 21 additions & 0 deletions .github/actions/publish-ppa-package/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 29 additions & 0 deletions .github/actions/publish-ppa-package/action.yml
Original file line number Diff line number Diff line change
@@ -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
75 changes: 75 additions & 0 deletions .github/actions/publish-ppa-package/build.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .github/actions/publish-ppa-package/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -l

set -o errexit -o pipefail -o nounset

/build.sh
6 changes: 6 additions & 0 deletions .github/actions/test_ubuntu_package/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions .github/actions/test_ubuntu_package/action.yml
Original file line number Diff line number Diff line change
@@ -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 }}

6 changes: 6 additions & 0 deletions .github/actions/test_ubuntu_package/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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])'
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
title: Scheduled CI job has failed
body: ${{ env.job_link }}

40 changes: 40 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -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*/'



12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
espresso (4.2.1-rc1) unstable; urgency=medium

* Initial release

-- Bishwash Krishna Parajuli <[email protected]> Fri, 03 Feb 2023 18:57:28 +0100


espresso (4.1.5~rc1) unstable; urgency=medium

* Initial release

-- Evangelos Ribeiro Tzaras <[email protected]> Sun, 28 Mar 2021 17:15:36 +0200
60 changes: 60 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Source: espresso
Section: science
Priority: optional
Maintainer: Espresso Maintainers <[email protected]>
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.
29 changes: 29 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: espresso
Upstream-Contact: Espresso mailing list <[email protected]>
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'.
10 changes: 10 additions & 0 deletions debian/gbp.conf
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS= hardening=+all

%:
dh $@


override_dh_auto_test:
true
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
3 changes: 3 additions & 0 deletions debian/watch
Original file line number Diff line number Diff line change
@@ -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