-
Notifications
You must be signed in to change notification settings - Fork 82
105 lines (102 loc) · 3.46 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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 }}