Skip to content

Commit 8e51a6b

Browse files
authored
Merge pull request #47 from oci-labs/feature/S28-master-workflow
Added workflow for master and develop
2 parents 7c559b9 + d865447 commit 8e51a6b

File tree

2 files changed

+113
-3
lines changed

2 files changed

+113
-3
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
name: Master and Develop Branch
3+
4+
on:
5+
push:
6+
branches:
7+
- 'master'
8+
- 'develop'
9+
10+
jobs:
11+
12+
test:
13+
name: Test - Units & Integrations
14+
runs-on: ubuntu-18.04
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up JDK 11
19+
uses: actions/setup-java@v1
20+
with:
21+
java-version: 1.8
22+
- name: Grant execute permission for gradlew
23+
run: chmod +x gradlew
24+
- name: Gradle package
25+
run: ./gradlew assembleServerAndClient
26+
27+
#TO-DO : setup sonar once we have completed Issue#25
28+
# sonar:
29+
# name: Test - SonarCloud Scan
30+
# runs-on: ubuntu-18.04
31+
32+
# steps:
33+
# - uses: actions/checkout@v1
34+
# - name: Set up JDK 11
35+
# uses: actions/setup-java@v1
36+
# with:
37+
# java-version: 1.8
38+
# - name: SonarCloud Scan
39+
# run: ./gradlew assembleServerAndClient -Psonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
40+
# env:
41+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
artifact:
44+
name: Publish - GitHub Packages
45+
runs-on: ubuntu-18.04
46+
#needs: [test, sonar]
47+
48+
steps:
49+
- uses: actions/checkout@v1
50+
- name: Set up JDK 11
51+
uses: actions/setup-java@v1
52+
with:
53+
java-version: 1.8
54+
- name: Publish artifact on GitHub Packages
55+
run: gradle publish
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
#TO-DO - Add a deployment step to GCP once the details are finalized.
60+
# docker:
61+
# name: Publish - Docker Hub
62+
# runs-on: ubuntu-18.04
63+
# needs: [test, sonar]
64+
# env:
65+
# REPO: ${{ secrets.DOCKER_REPO }}
66+
67+
# steps:
68+
# - uses: actions/checkout@v1
69+
# - name: Set up JDK 11
70+
# uses: actions/setup-java@v1
71+
# with:
72+
# java-version: 1.8
73+
# - name: Login to Docker Hub
74+
# run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }}
75+
# - name: Build Docker image
76+
# run: docker build -t $REPO:latest -t $REPO:${GITHUB_SHA::8} .
77+
# - name: Publish Docker image
78+
# run: docker push $REPO

build.gradle

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
plugins {
2+
id 'java-library'
3+
id 'maven-publish'
4+
}
5+
16
task copyClientResources(dependsOn: ':web-ui:build') {
27
group = 'build'
38
description = 'Copy web-ui resources into server'
@@ -15,10 +20,37 @@ task assembleServerAndClient(dependsOn: ['copyClientResources', ':server:shadowJ
1520
description = 'Build combined server & client JAR'
1621
}
1722

18-
task test {
23+
// task test {
1924

20-
}
25+
// }
26+
27+
28+
// task check {
29+
30+
// }
2131

22-
task check {
32+
publishing {
33+
publications {
34+
checkInsProject(MavenPublication) {
35+
version "0.1"
36+
group "com.objectcomputing.checkins"
37+
from components.java
38+
39+
}
40+
}
2341

42+
repositories {
43+
maven {
44+
name = "CheckInsProject"
45+
url = "https://maven.pkg.github.com/oci-labs/check-ins"
46+
credentials {
47+
username = System.getenv("GITHUB_ACTOR")!=null?System.getenv("GITHUB_ACTOR"):"OCI-LABS"
48+
password = System.getenv("GITHUB_TOKEN")!=null?System.getenv("GITHUB_TOKEN"):"OCI-LABS"
49+
}
50+
}
51+
}
2452
}
53+
54+
55+
56+

0 commit comments

Comments
 (0)