Skip to content

Commit

Permalink
added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelwurm committed Sep 7, 2021
1 parent d079563 commit 23eb9ee
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 5 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: volumehidtoosc_build_release

on:
push:
branches:
- main
tags: [ v**]
paths:
- '**'
- '!Docs/**'
- '!README.md'
pull_request:
branches:
- main
tags: [ v**]
paths:
- '**'
- '!Docs/**'
- '!README.md'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: set Version
if: ${{ (startsWith(github.ref, 'refs/tags/v')) }}
run: echo "VOLUMEHIDTOOSCDVER=$(echo ${GITHUB_REF} | sed 's|refs/heads/||g' | sed 's|refs/tags/v||g' | sed 's|-beta||g' )" >> $GITHUB_ENV
- name: set Version
if: ${{ !(startsWith(github.ref, 'refs/tags/v')) }}
run: echo "VOLUMEHIDTOOSCDVER=1.0.0-1" >> $GITHUB_ENV
- name: set majorVersion
run: echo "VOLUMEHIDTOOSCDMAJORVER=$(echo $VOLUMEHIDTOOSCDVER | sed 's|-.*$||g' | cut -d. -f1 )" >> $GITHUB_ENV
- name: set minorVersion
run: echo "VOLUMEHIDTOOSCDMINORVER=$(echo $VOLUMEHIDTOOSCDVER | sed 's|-.*$||g' | cut -d. -f2 )" >> $GITHUB_ENV
- name: set patchVersion
run: echo "VOLUMEHIDTOOSCDPATCHVER=$(echo $VOLUMEHIDTOOSCDVER | sed 's|-.*$||g' | cut -d. -f3 )" >> $GITHUB_ENV
- name: set version control
run: 'sed -i "s|Version: .*$|Version: $VOLUMEHIDTOOSCDVER|g" DEBIAN/control'

- name: set majorVersion cmake
run: 'sed -i "s|^set.*VERSION_MAJOR.*$|set (\${PROJECT_NAME}_VERSION_MAJOR $VOLUMEHIDTOOSCDMAJORVER)|g" CMakeLists.txt'
- name: set minorVersion cmake
run: 'sed -i "s|^set.*VERSION_MINOR.*$|set (\${PROJECT_NAME}_VERSION_MINOR $VOLUMEHIDTOOSCDMINORVER)|g" CMakeLists.txt'
- name: set patchVersion cmake
run: 'sed -i "s|^set.*PATCH_LEVEL.*$|set (\${PROJECT_NAME}_PATCH_LEVEL $VOLUMEHIDTOOSCDPATCHVER)|g" CMakeLists.txt'

- name: run build
run: './rebuild.sh'
- name: move build
run: 'mv build/volumehidtoosc_1.0.0_amd64.deb $(echo "build/volumehidtoosc_"$VOLUMEHIDTOOSCDVER"_amd64.deb")'
- name: list
run: 'ls -la build/'
- name: list
run: 'cat CMakeLists.txt'
- name: list
run: 'cat DEBIAN/control'
- name: make release
if: ${{ (startsWith(github.ref, 'refs/tags/v')) && (!(contains(github.ref, '-beta'))) }}
uses: softprops/action-gh-release@v1
with:
files: |
./build/volumehidtoosc_*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: make release
if: ${{ (startsWith(github.ref, 'refs/tags/v')) && ((contains(github.ref, '-beta'))) }}
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: |
./build/volumehidtoosc_*.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ install_manifest.txt
.cproject
.project
.settings/
build/
.github
build/
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ working:
* config file

todo:
* OSC testing
* ci
* service implementation
* documentation

0 comments on commit 23eb9ee

Please sign in to comment.