Skip to content

Commit fdf3e1c

Browse files
Add utbot-framework-api publications on GitHub Packages closes #142 (#147)
1 parent 240c55d commit fdf3e1c

4 files changed

Lines changed: 131 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: "[M] Publish on GitHub Packages"
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
build_and_run_tests:
7+
if: ${{ github.actor == 'korifey' || github.actor == 'denis-fokin' || github.actor == 'victoriafomina' ||
8+
github.actor == 'bissquit' }}
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-java@v3
13+
with:
14+
java-version: '8'
15+
distribution: 'zulu'
16+
java-package: jdk+fx
17+
cache: gradle
18+
- uses: gradle/gradle-build-action@v2
19+
with:
20+
gradle-version: 6.8
21+
22+
- name: "UTBot Java: build and run tests"
23+
run: |
24+
export KOTLIN_HOME="/usr"
25+
gradle clean build --no-daemon
26+
27+
- name: Upload utbot-framework logs
28+
if: ${{ failure() }}
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: utbot_framework_logs
32+
path: utbot-framework/logs/*
33+
34+
- name: Upload utbot-framework tests report artifacts if tests have failed
35+
if: ${{ failure() }}
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: utbot_framework_tests_report
39+
path: utbot-framework/build/reports/tests/test/*
40+
41+
publish_framework-api_and_dependencies:
42+
needs: build_and_run_tests
43+
runs-on: ubuntu-20.04
44+
permissions:
45+
packages: write
46+
contents: read
47+
steps:
48+
- uses: actions/checkout@v3
49+
- uses: actions/setup-java@v3
50+
with:
51+
java-version: '8'
52+
distribution: 'zulu'
53+
java-package: jdk+fx
54+
cache: gradle
55+
- uses: gradle/gradle-build-action@v2
56+
with:
57+
gradle-version: 6.8
58+
arguments: publish
59+
env:
60+
GITHUB_ACTOR: ${{ github.actor }}
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
63+
- name: Set project version
64+
run:
65+
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
66+
67+
- name: "utbot-framework-api: build and run tests"
68+
run: |
69+
cd utbot-framework-api
70+
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT
71+
72+
- name: "utbot-api: build"
73+
run: |
74+
cd utbot-api
75+
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT
76+
77+
- name: "utbot-core: build"
78+
run: |
79+
cd utbot-core
80+
gradle clean build --no-daemon -PsemVer=${{ env.VERSION }}-SNAPSHOT

utbot-api/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
plugins {
2+
id 'maven-publish'
3+
}
4+
15
apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"
6+
7+
publishing {
8+
repositories {
9+
maven {
10+
name = "GitHubPackages"
11+
url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava"
12+
credentials {
13+
username = System.getenv("GITHUB_ACTOR")
14+
password = System.getenv("GITHUB_TOKEN")
15+
}
16+
}
17+
}
18+
}

utbot-core/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
plugins {
2+
id 'maven-publish'
3+
}
4+
15
apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"
26

37
dependencies {
48
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version
59
implementation group: 'net.java.dev.jna', name: 'jna-platform', version: '5.5.0'
610
}
11+
12+
publishing {
13+
repositories {
14+
maven {
15+
name = "GitHubPackages"
16+
url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava"
17+
credentials {
18+
username = System.getenv("GITHUB_ACTOR")
19+
password = System.getenv("GITHUB_TOKEN")
20+
}
21+
}
22+
}
23+
}

utbot-framework-api/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'maven-publish'
3+
}
4+
15
apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"
26

37

@@ -9,4 +13,17 @@ dependencies {
913
// TODO do we really need apache commons?
1014
implementation group: 'org.apache.commons', name: 'commons-lang3', version: commons_lang_version
1115
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version
16+
}
17+
18+
publishing {
19+
repositories {
20+
maven {
21+
name = "GitHubPackages"
22+
url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava"
23+
credentials {
24+
username = System.getenv("GITHUB_ACTOR")
25+
password = System.getenv("GITHUB_TOKEN")
26+
}
27+
}
28+
}
1229
}

0 commit comments

Comments
 (0)