-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from CESNET/devel
Github Actions: merge workflows for RPM/DEB packages
- Loading branch information
Showing
4 changed files
with
104 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Build RPM/DEB packages | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
deb: | ||
# Try to build DEB packages | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: ['ubuntu:18.04', 'ubuntu:19.04', 'ubuntu:20.04', 'debian:stretch', 'debian:buster', 'debian:bullseye'] | ||
|
||
name: Build DEBs on ${{ matrix.image }} | ||
container: ${{ matrix.image }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Define global variables | ||
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip" | ||
shell: bash | ||
env: | ||
IMAGE: ${{ matrix.image }} | ||
id: vars | ||
|
||
# Dependencies --------------------------------------------------------------------------- | ||
- name: Install dependencies (Ubuntu/Debian) | ||
run: | | ||
apt-get update | ||
apt-get -y install git gcc g++ cmake make libxml2-dev liblz4-dev libzstd-dev | ||
apt-get -y install debhelper pkg-config devscripts build-essential fakeroot zip | ||
# Build ---------------------------------------------------------------------------------- | ||
- name: Build DEB packages | ||
run: | | ||
mkdir build && cd build | ||
cmake .. -DPACKAGE_BUILDER_DEB=On -DCPACK_PACKAGE_CONTACT="GitHub actions <[email protected]>" | ||
make deb | ||
- name: Pack DEB packages | ||
working-directory: 'build/pkg/deb/debbuild/' | ||
run: zip "$GITHUB_WORKSPACE/$ZIP_FILE" *.deb *.ddeb *.tar.gz *.dsc | ||
env: | ||
ZIP_FILE: ${{ steps.vars.outputs.zip_file }} | ||
- name: Archive DEB packages | ||
if: github.event_name == 'push' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ steps.vars.outputs.zip_file }} | ||
path: ${{ steps.vars.outputs.zip_file }} | ||
|
||
rpm: | ||
# Try to build RPM packages | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: ['centos:7', 'centos:8', 'fedora:29', 'fedora:30', 'fedora:31'] | ||
|
||
name: Build RPMs on ${{ matrix.image }} | ||
container: ${{ matrix.image }} | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Define global variables | ||
run: echo "::set-output name=zip_file::libfds-${IMAGE//:/}-$GITHUB_SHA.zip" | ||
env: | ||
IMAGE: ${{ matrix.image }} | ||
id: vars | ||
|
||
# Dependencies --------------------------------------------------------------------------- | ||
- name: Install dependencies (CentOS) | ||
if: startsWith(matrix.image, 'centos') | ||
run: | | ||
yum -y install epel-release | ||
yum -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel rpm-build | ||
- name: Install depedencies (Fedora) | ||
if: startsWith(matrix.image, 'fedora') | ||
run: dnf -y install git gcc gcc-c++ cmake make libxml2-devel lz4-devel libzstd-devel rpm-build | ||
|
||
# Build ---------------------------------------------------------------------------------- | ||
- name: Build RPM packages | ||
run: | | ||
mkdir build && cd build | ||
cmake .. -DPACKAGE_BUILDER_RPM=On -DCPACK_PACKAGE_CONTACT="GitHub actions <[email protected]>" | ||
make rpm | ||
- name: Pack RPM packages | ||
working-directory: 'build/pkg/rpm/rpmbuild' | ||
run: zip -r "$GITHUB_WORKSPACE/$ZIP_FILE" RPMS SRPMS | ||
env: | ||
ZIP_FILE: ${{ steps.vars.outputs.zip_file }} | ||
- name: Archive RPM packages | ||
if: github.event_name == 'push' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ steps.vars.outputs.zip_file }} | ||
path: ${{ steps.vars.outputs.zip_file }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.