diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..899b53e --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,161 @@ +name: Package mc-openrtm + +# This workflow only runs when pushing to master or pushing a tag +# +# On master, it will: +# - Build packages for selected Debian/Ubuntu distro +# - Upload the packages to https://dl.bintray.com/gergondet/multi-contact-head +# +# On tagged versions it will: +# - Create a GitHub release draft +# - Attach the sources to the release +# - Build packages for selected Debian/Ubuntu distro +# - Upload the packages to https://dl.bintray.com/gergondet/multi-contact +# - Finalize the release + +on: + push: + branches: + - master + tags: + - v* + +jobs: + # For a given tag vX.Y.Z, this checks: + # - set(PROJECT_VERSION X.Y.Z) in CMakeLists.txt + # - version X.Y.Z in debian/changelog + # If these checks fail, the tag is automatically deleted + # + # This job does not run on the master branch + check-tag: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + if: github.ref != 'refs/heads/master' + - name: Check version coherency + run: | + set -x + export VERSION=`echo ${{ github.ref }} | sed -e 's@refs/tags/v@@'` + echo "::set-env name=REJECTION::PROJECT_VERSION in CMakeLists.txt does not match tag" + grep -q "set(PROJECT_VERSION ${VERSION})" CMakeLists.txt + echo "::set-env name=REJECTION::Upstream version in debian/changelog does not match tag" + head -n 1 debian/changelog | grep -q "mc-openrtm (${VERSION}" + echo "::set-env name=REJECTION::" + export TAG=`echo ${{ github.ref }} | sed -e 's@refs/tags/@@'` + echo "::set-env name=RELEASE_TAG::${TAG}" + if: github.ref != 'refs/heads/master' + - name: Delete tag + run: | + set -x + curl --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X DELETE https://api.github.com/repos/${{ github.repository }}/git/${{ github.ref }} + if: failure() + - name: Notify tag deletion + uses: archive/github-actions-slack@master + with: + slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }} + slack-channel: '#ci' + slack-text: > + Tag *${{ github.ref }}* in *${{ github.repository }}* was deleted: + ${{ env.REJECTION}} + if: failure() + - name: Create release + uses: jrl-umi3218/github-actions/create-release@master + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ env.RELEASE_TAG }} + if: github.ref != 'refs/heads/master' + # This job build binary packages for Ubuntu + build-packages: + needs: check-tag + strategy: + fail-fast: true + matrix: + dist: [xenial, bionic] + arch: [i386, amd64] + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + with: + submodules: recursive + - name: Setup environment + run: | + set -x + export REF=`echo ${{ github.ref }} | sed -e 's@refs/[a-z]*/@@'` + if [ $REF == "master" ] + then + echo "::set-env name=EXTRA_MIRROR::https://dl.bintray.com/gergondet/multi-contact-head" + else + echo "::set-env name=EXTRA_MIRROR::https://dl.bintray.com/gergondet/multi-contact-release" + fi + - name: Build package + uses: jrl-umi3218/github-actions/build-package-native@master + with: + dist: ${{ matrix.dist }} + arch: ${{ matrix.arch }} + other-mirrors: ${{ env.EXTRA_MIRROR }} + other-gpg-keys: "0x892EA6EE273707C6495A6FB6220D644C64666806" + - uses: actions/upload-artifact@v1 + with: + name: packages-${{ matrix.dist }}-${{ matrix.arch }} + path: /tmp/packages-${{ matrix.dist }}-${{ matrix.arch }} + # This job upload binary packages for Ubuntu + upload-packages: + needs: build-packages + strategy: + max-parallel: 1 + fail-fast: true + matrix: + dist: [xenial, bionic] + arch: [i386, amd64] + runs-on: ubuntu-18.04 + steps: + - name: Set upload parameters + run: | + export REF=`echo ${{ github.ref }} | sed -e 's@refs/[a-z]*/@@'` + if [ $REF == "master" ] + then + echo "::set-env name=BINTRAY_REPO::multi-contact-head" + echo "::set-env name=BINTRAY_VERSION::HEAD" + else + echo "::set-env name=BINTRAY_REPO::multi-contact-release" + echo "::set-env name=BINTRAY_VERSION::${REF}" + fi + - name: Download packages + uses: actions/download-artifact@v1 + with: + name: packages-${{ matrix.dist }}-${{ matrix.arch }} + - name: Upload + uses: jrl-umi3218/github-actions/upload-package@master + with: + dist: ${{ matrix.dist }} + arch: ${{ matrix.arch }} + subject: gergondet + repo: ${{ env.BINTRAY_REPO }} + package: | + name: mc-openrtm + desc: "Interface between OpenRTM and mc_rtc" + licenses: [BSD 2-Clause] + vcs_url: https://github.com/jrl-umi3218/mc_openrtm + version: ${{ env.BINTRAY_VERSION }} + path: packages-${{ matrix.dist }}-${{ matrix.arch }} + BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + # This job forces a mirror sync + mirror-sync: + needs: upload-packages + runs-on: ubuntu-18.04 + steps: + - name: Set repository parameters + run: | + export REF=`echo ${{ github.ref }} | sed -e 's@refs/[a-z]*/@@'` + if [ $REF == "master" ] + then + echo "::set-env name=BINTRAY_REPO::multi-contact-head" + else + echo "::set-env name=BINTRAY_REPO::multi-contact-release" + fi + - name: Request mirror sync + run: | + curl -ugergondet:${{ secrets.BINTRAY_API_KEY }} --header "X-GPG-PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}" -X POST https://api.bintray.com/calc_metadata/gergondet/${{ env.BINTRAY_REPO }} diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..f66be31 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +mc-openrtm (1.0.0-1ubuntu1) unstable; urgency=medium + + * Initial release + + -- Pierre Gergondet Mon, 30 Dec 2019 16:40:13 +0800 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..c78cc5c --- /dev/null +++ b/debian/control @@ -0,0 +1,33 @@ +Source: mc-openrtm +Priority: optional +Maintainer: Pierre Gergondet +Standards-Version: 3.9.5 +Section: science +Homepage: https://github.com/jrl-umi3218/mc_openrtm +Vcs-Git: https://github.com/jrl-umi3218/mc_openrtm +Vcs-Browser: https://github.com/jrl-umi3218/mc_openrtm +Build-Depends: debhelper (>= 9), + cmake, + hrpsys-base, + libcnoid-dev, + libmc-rtc-dev + +Package: mc-openrtm +Section: science +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends} +Suggests: jvrc-choreonoid +Description: mc-openrtm - Interface between OpenRTM and mc_rtc + This package contains an interface between OpenRTM and mc_rtc to be used in + the Choreonoid simulation interface. + +Package: jvrc-choreonoid +Section: science +Architecture: any +Depends: mc-openrtm (= ${binary:Version}), + ${shlibs:Depends}, + choreonoid +Description: Choreonoid project for mc_openrtm and JVRC1 + This package contains a sample Choreonoid project using the JVRC1 robot and + the correct mc_rtc interface. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..03239f6 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,53 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mc_openrtm +Source: https://gite.lirmm.fr/multi-contact/mc_openrtm + +Files: * +Copyright: 2016-2019 CNRS-UM LIRMM + 2016-2019 CNRS-AIST JRL +License: BSD-2-Clause + BSD 2-Clause License + . + Copyright (c) 2016-2019, CNRS-UM LIRMM, CNRS-AIST JRL + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Files: debian/* +Copyright: 2019 Pierre Gergondet +License: GPL-2+ + This package 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 2 of the License, or + (at your option) any later version. + . + This package 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 program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/jvrc-choreonoid.install b/debian/jvrc-choreonoid.install new file mode 100644 index 0000000..fb72495 --- /dev/null +++ b/debian/jvrc-choreonoid.install @@ -0,0 +1,2 @@ +usr/share/OpenHRP-3.1/* +usr/lib/choreonoid*/* diff --git a/debian/mc-openrtm.install b/debian/mc-openrtm.install new file mode 100644 index 0000000..ef475ab --- /dev/null +++ b/debian/mc-openrtm.install @@ -0,0 +1,4 @@ +usr/bin/MCControlComp +usr/lib/MCControl.so +usr/lib/python2.7/* +usr/share/hrpsys/* diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..95e5041 --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +%: + dh $@ --parallel diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides new file mode 100644 index 0000000..1cfe16f --- /dev/null +++ b/debian/source.lintian-overrides @@ -0,0 +1 @@ +mc-rtc source: source-is-missing cmake/doxygen/MathJax/* diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)