Skip to content

Commit 888b2b1

Browse files
author
Felix Exner
authored
Merge pull request #10 from UniversalRobots/gh_actions
Added GH actions to build
2 parents 9ee1359 + 764271e commit 888b2b1

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Container image that runs your code
2+
FROM ubuntu:bionic
3+
4+
# Copies your code file from your action repository to the filesystem path `/` of the container
5+
COPY entrypoint.sh /entrypoint.sh
6+
7+
RUN apt-get update && apt-get install -y \
8+
default-jdk\
9+
maven\
10+
unzip\
11+
dialog\
12+
sshpass\
13+
curl
14+
15+
# Code file to execute when the docker container starts up (`entrypoint.sh`)
16+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# action.yml
2+
name: 'Build URCap'
3+
description: 'Builds a URCap in a container'
4+
runs:
5+
using: 'docker'
6+
image: 'Dockerfile'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SDK_MAJOR=$(echo ${SDK_VERSION} | awk -F. '{print $1}')
6+
SDK_MINOR=$(echo ${SDK_VERSION} | awk -F. '{print $2}')
7+
SDK_BUILD=$(echo ${SDK_VERSION} | awk -F. '{print $3}')
8+
9+
download_folder=$(mktemp -d)
10+
pushd ${download_folder}
11+
curl -o sdk-${SDK_VERSION}.zip https://s3-eu-west-1.amazonaws.com/urplus-developer-site/sdk/sdk-${SDK_VERSION}.zip
12+
mkdir sdk
13+
unzip -q sdk-${SDK_VERSION}.zip -d sdk
14+
if [ "$SDK_MAJOR" -eq 1 ] && [ "$SDK_MINOR" -lt 10 ]; then
15+
cd sdk
16+
else
17+
cd sdk/URCap_SDK-${SDK_VERSION}
18+
fi
19+
./install.sh
20+
21+
popd
22+
23+
mvn install

.github/workflows/build.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Build URCap
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
SDK_VERSION: [1.6.1, 1.7.0, 1.8.0, 1.9.0]
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- uses: ./.github/actions/build_urcap
15+
env:
16+
SDK_VERSION: ${{ matrix.SDK_VERSION }}
17+
- name: Upload urcap_artifact
18+
uses: actions/upload-artifact@v1
19+
with:
20+
path: target
21+
name: external_control_sdk-${{ matrix.SDK_VERSION }}.urcap
22+

0 commit comments

Comments
 (0)