Skip to content

Commit

Permalink
[packaging] Setup packaging with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Dec 30, 2019
1 parent 23a3832 commit 962dc25
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 0 deletions.
161 changes: 161 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -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 }}
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mc-openrtm (1.0.0-1ubuntu1) unstable; urgency=medium

* Initial release

-- Pierre Gergondet <pierre.gergondet+ppa@gmail.com> Mon, 30 Dec 2019 16:40:13 +0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
33 changes: 33 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Source: mc-openrtm
Priority: optional
Maintainer: Pierre Gergondet <pierre.gergondet+ppa@gmail.com>
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.
53 changes: 53 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -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 <pierre.gergondet+ppa@gmail.com>
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 <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
2 changes: 2 additions & 0 deletions debian/jvrc-choreonoid.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usr/share/OpenHRP-3.1/*
usr/lib/choreonoid*/*
4 changes: 4 additions & 0 deletions debian/mc-openrtm.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
usr/bin/MCControlComp
usr/lib/MCControl.so
usr/lib/python2.7/*
usr/share/hrpsys/*
5 changes: 5 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/make -f
# -*- makefile -*-

%:
dh $@ --parallel
1 change: 1 addition & 0 deletions debian/source.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mc-rtc source: source-is-missing cmake/doxygen/MathJax/*
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)

0 comments on commit 962dc25

Please sign in to comment.