Skip to content

Commit

Permalink
Merge pull request #2 from richardmarston/github-build-action
Browse files Browse the repository at this point in the history
Build RPM and DEB packages in github CI
  • Loading branch information
m-mirz authored Sep 24, 2020
2 parents 17ad683 + 09c3c90 commit 2e39ca2
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

name: Docker Image CI
description: 'Create package'
runs:
using: 'docker'
image: 'Dockerfile'

45 changes: 45 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: package build workflow
# https://www.patriksvensson.se/2020/03/creating-release-artifacts-with-github-actions/
# https://github.community/t5/GitHub-Actions/Using-on-push-tags-ignore-and-paths-ignore-together/td-p/38559
# https://github.com/softprops/action-gh-release
# https://github.com/actions/download-artifact

on:
push:
tags:
- 'release/v*'

jobs:
package:
runs-on: ubuntu-latest
name: A job to build the packages
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
id: build-it-now
uses: ./
- name: UploadRPM
uses: actions/upload-artifact@v2
with:
name: rpm
path: ${{ github.workspace }}/build/*.rpm
- name: UploadDEB
uses: actions/upload-artifact@v2
with:
name: deb
path: ${{ github.workspace }}/build/*.deb
release:
needs: package
runs-on: ubuntu-latest
steps:
- name: GetArtifact
uses: actions/download-artifact@v2
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
rpm/*
deb/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libexpat1")
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/jezhiggins/arabica")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")

set(CPACK_RPM_PACKAGE_LICENSE "BSD 3-clause")
set(CPACK_RPM_PACKAGE_URL "https://github.com/jezhiggins/arabica")
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

from alpine:latest

run apk update
run apk add boost-dev g++ make
run apk add cmake expat-dev rpm
copy entrypoint.sh entrypoint.sh

entrypoint [ "./entrypoint.sh" ]
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

cd /github/workspace
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON ..
cpack

0 comments on commit 2e39ca2

Please sign in to comment.