Update README.md (#138) #195
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
name: Oreka Build | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v** | |
pull_request: | |
branches: | |
- master | |
jobs: | |
oreka_cpp_job: | |
runs-on: ubuntu-latest | |
name: Build Orkaudio | |
services: | |
registry: | |
image: registry:2 | |
ports: | |
- 5000:5000 | |
strategy: | |
fail-fast: false | |
matrix: | |
os-version: [ "xenial", "bionic", "focal" ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Clone build-tool repo | |
run : | | |
git clone https://github.com/voiceip/oreka-build.git ./oreka-build | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
with: | |
driver-opts: network=host | |
- name: Cache Docker layers ${{ matrix.os-version }} | |
uses: actions/cache@v2 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ matrix.os-version }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx-${{ matrix.os-version }}- | |
- name: Build Docker Image for ubuntu-${{ matrix.os-version }} | |
uses: docker/build-push-action@v2 | |
with: | |
# using "load: true" forces the docker driver | |
# not necessary here, because we set it before | |
#load: true | |
push: true | |
tags: localhost:5000/${{ github.repository_owner }}/oreka-${{ matrix.os-version }}:latest | |
context: . | |
file: ./.devcontainer/Dockerfile.orkaudio.build | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | |
build-args: | | |
TAG=${{ matrix.os-version }} | |
- name: Compile | |
run: | | |
docker run -v $(pwd)/oreka-build:/oreka-build -v $(pwd):/oreka-src -i -i localhost:5000/${{ github.repository_owner }}/oreka-${{ matrix.os-version }}:latest bash /entrypoint.sh | |
mv ./oreka-build/distribution/orkaudio.deb ./oreka-build/distribution/orkaudio_${{ matrix.os-version }}.deb | |
- name: Upload deb binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: orkaudio_${{ matrix.os-version }}.deb | |
path: ./oreka-build/distribution/orkaudio_${{ matrix.os-version }}.deb | |
- name: "Create release" | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
artifacts: "./oreka-build/distribution/*.deb" | |
draft: true | |
allowUpdates: true | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache | |
oreka_java_job: | |
runs-on: ubuntu-latest | |
name: Build Orkweb & Orktrack | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Cache Maven packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Build with Maven | |
run: | | |
mvn clean install -DskipTests -Dmaven.test.skip=true | |
- name: "Create release" | |
uses: ncipollo/release-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
with: | |
artifacts: "orktrack/target/*.war,orkweb/target/*.war" | |
draft: true | |
allowUpdates: true | |
token: ${{ secrets.GH_TOKEN }} |