diff --git a/.github/workflows/publish-on-github-packages.yml b/.github/workflows/publish-on-github-packages.yml index ac27d081da..9fb1e3e2cf 100644 --- a/.github/workflows/publish-on-github-packages.yml +++ b/.github/workflows/publish-on-github-packages.yml @@ -9,10 +9,13 @@ on: description: "commit SHA: e.g. cab4799c" jobs: - build_and_run_tests: + publish_on_github_packages: if: ${{ github.actor == 'korifey' || github.actor == 'denis-fokin' || github.actor == 'victoriafomina' || github.actor == 'bissquit' }} runs-on: ubuntu-20.04 + permissions: + packages: write + contents: read steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -24,12 +27,17 @@ jobs: - uses: gradle/gradle-build-action@v2 with: gradle-version: 6.8 - + + - name: Check out ${{ github.event.inputs.commit-sha }} commit + run: | + git fetch + git checkout ${{ github.event.inputs.commit-sha }} + - name: "UTBot Java: build and run tests" run: | export KOTLIN_HOME="/usr" gradle clean build --no-daemon - + - name: Upload utbot-framework logs if: ${{ failure() }} uses: actions/upload-artifact@v2 @@ -43,21 +51,7 @@ jobs: with: name: utbot_framework_tests_report path: utbot-framework/build/reports/tests/test/* - - publish_utbot: - needs: build_and_run_tests - runs-on: ubuntu-20.04 - permissions: - packages: write - contents: read - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - java-version: '8' - distribution: 'zulu' - java-package: jdk+fx - cache: gradle + - uses: gradle/gradle-build-action@v2 with: gradle-version: 6.8 @@ -65,23 +59,3 @@ jobs: env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check out ${{ github.event.inputs.commit-sha }} commit - run: | - git fetch - git checkout ${{ github.event.inputs.commit-sha }} - - - name: "utbot-framework-api: build and run tests" - run: | - cd utbot-framework-api - gradle clean build --no-daemon - - - name: "utbot-api: build" - run: | - cd utbot-api - gradle clean build --no-daemon - - - name: "utbot-core: build" - run: | - cd utbot-core - gradle clean build --no-daemon diff --git a/utbot-framework/build.gradle b/utbot-framework/build.gradle index 2e3c4a7190..932c3524f9 100644 --- a/utbot-framework/build.gradle +++ b/utbot-framework/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'maven-publish' +} + apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle" repositories { @@ -74,4 +78,17 @@ test { if (System.getProperty('DEBUG', 'false') == 'true') { jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009' } -} \ No newline at end of file +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} diff --git a/utbot-fuzzers/build.gradle b/utbot-fuzzers/build.gradle index 1f0870c630..f6dbba0724 100644 --- a/utbot-fuzzers/build.gradle +++ b/utbot-fuzzers/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'maven-publish' +} + apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle" dependencies { @@ -9,3 +13,16 @@ dependencies { compileJava { options.compilerArgs = [] } + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} diff --git a/utbot-instrumentation/build.gradle b/utbot-instrumentation/build.gradle index cf64580cb1..1c380c97ba 100644 --- a/utbot-instrumentation/build.gradle +++ b/utbot-instrumentation/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'maven-publish' +} + apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle" dependencies { @@ -32,4 +36,17 @@ configurations { artifacts { instrumentationArchive jar -} \ No newline at end of file +} + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/UnitTestBot/UTBotJava" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +}