Skip to content

try to build ultimate plugin each time on pr event #1836 #1837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ jobs:
uses: ./.github/workflows/build-and-run-tests-from-branch.yml
secrets: inherit

publish_plugin_and_cli:
needs: build-and-run-tests
uses: ./.github/workflows/publish-plugin-and-cli-from-branch.yml
with:
minor-release: 'none'
# upload artifacts on push action to main only
upload-artifact: ${{ github.event_name == 'push' }}
secrets: inherit

publish-cli-image:
needs: build-and-run-tests
Expand Down
42 changes: 29 additions & 13 deletions .github/workflows/publish-plugin-and-cli-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ on:
description: "It adds minor release indicator to version."
required: false
default: 'none'

version-postfix:
type: string
description: "It adds postfix (alpha or beta) to version (optional)."
required: false
default: no-postfix
upload-artifact:
type: string
description: "Upload artifacts or not"
required: false
default: false

workflow_dispatch:
inputs:
Expand All @@ -28,7 +32,6 @@ on:
- '2'
- '3'
- '4'

version-postfix:
type: choice
description: "It adds alpha or beta postfix to version."
Expand All @@ -39,48 +42,60 @@ on:
- no-postfix
- alpha
- beta
upload-artifact:
type: choice
description: "Upload artifacts or not"
required: false
default: true
options:
- true
- false

jobs:
publish_plugin_and_cli:
strategy:
fail-fast: false # force to execute all jobs even though some of them have failed
matrix:
configuration:
- plugin_type: IC
extra_options: "-PideType=IC"
- plugin_type: IU
extra_options: "-PideType=IU"
runs-on: ubuntu-20.04
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0

steps:
- name: Print environment variables
run: printenv

- uses: actions/checkout@v3

# "You can make an environment variable available to any subsequent steps in a workflow job by
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
- name: Set environment variables
run: |
# "You can make an environment variable available to any subsequent steps in a workflow job by
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV

- name: Set production version
if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }}
run: |
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV

- name: Set version for minor release
if: ${{ github.event.inputs.minor-release != 'none' }}
run: |
echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV

- name: Create version with postfix
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
run:
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
- name: Print environment variables
run: printenv

- name: Build UTBot IntelliJ IDEA plugin
run: |
gradle clean buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
gradle clean buildPlugin --no-daemon --build-cache --no-parallel ${{ matrix.configuration.extra_options }} -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}
cd utbot-intellij/build/distributions
unzip utbot-intellij-${{ env.VERSION }}.zip
rm utbot-intellij-${{ env.VERSION }}.zip

- name: Archive UTBot IntelliJ IDEA plugin
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
uses: actions/upload-artifact@v3
with:
name: utbot-intellij-${{ env.VERSION }}
Expand All @@ -90,8 +105,9 @@ jobs:
run: |
cd utbot-cli
gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }}

- name: Archive UTBot CLI
if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }}
uses: actions/upload-artifact@v3
with:
name: utbot-cli-${{ env.VERSION }}
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/publish-plugin-and-cli.yml

This file was deleted.