|
8 | 8 | description: "It adds minor release indicator to version." |
9 | 9 | required: false |
10 | 10 | default: 'none' |
11 | | - |
12 | 11 | version-postfix: |
13 | 12 | type: string |
14 | 13 | description: "It adds postfix (alpha or beta) to version (optional)." |
15 | 14 | required: false |
16 | 15 | default: no-postfix |
| 16 | + upload-artifact: |
| 17 | + type: string |
| 18 | + description: "Upload artifacts or not" |
| 19 | + required: false |
| 20 | + default: false |
17 | 21 |
|
18 | 22 | workflow_dispatch: |
19 | 23 | inputs: |
|
28 | 32 | - '2' |
29 | 33 | - '3' |
30 | 34 | - '4' |
31 | | - |
32 | 35 | version-postfix: |
33 | 36 | type: choice |
34 | 37 | description: "It adds alpha or beta postfix to version." |
|
39 | 42 | - no-postfix |
40 | 43 | - alpha |
41 | 44 | - beta |
| 45 | + upload-artifact: |
| 46 | + type: choice |
| 47 | + description: "Upload artifacts or not" |
| 48 | + required: false |
| 49 | + default: true |
| 50 | + options: |
| 51 | + - true |
| 52 | + - false |
42 | 53 |
|
43 | 54 | jobs: |
44 | 55 | publish_plugin_and_cli: |
| 56 | + strategy: |
| 57 | + fail-fast: false # force to execute all jobs even though some of them have failed |
| 58 | + matrix: |
| 59 | + configuration: |
| 60 | + - plugin_type: IC |
| 61 | + extra_options: "-PideType=IC" |
| 62 | + - plugin_type: IU |
| 63 | + extra_options: "-PideType=IU" |
45 | 64 | runs-on: ubuntu-20.04 |
46 | 65 | container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0 |
47 | | - |
48 | 66 | steps: |
49 | | - - name: Print environment variables |
50 | | - run: printenv |
51 | | - |
52 | 67 | - uses: actions/checkout@v3 |
53 | 68 |
|
| 69 | + # "You can make an environment variable available to any subsequent steps in a workflow job by |
| 70 | + # defining or updating the environment variable and writing this to the GITHUB_ENV environment file." |
54 | 71 | - name: Set environment variables |
55 | 72 | run: | |
56 | | - # "You can make an environment variable available to any subsequent steps in a workflow job by |
57 | | - # defining or updating the environment variable and writing this to the GITHUB_ENV environment file." |
58 | 73 | echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV |
59 | 74 | echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV |
60 | | -
|
61 | 75 | - name: Set production version |
62 | 76 | if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }} |
63 | 77 | run: | |
64 | 78 | echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV |
65 | | -
|
66 | 79 | - name: Set version for minor release |
67 | 80 | if: ${{ github.event.inputs.minor-release != 'none' }} |
68 | 81 | run: | |
69 | 82 | echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV |
70 | | -
|
71 | 83 | - name: Create version with postfix |
72 | 84 | if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }} |
73 | 85 | run: |
74 | 86 | echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV |
| 87 | + - name: Print environment variables |
| 88 | + run: printenv |
75 | 89 |
|
76 | 90 | - name: Build UTBot IntelliJ IDEA plugin |
77 | 91 | run: | |
78 | | - gradle clean buildPlugin --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} |
| 92 | + 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 }} |
79 | 93 | cd utbot-intellij/build/distributions |
80 | 94 | unzip utbot-intellij-${{ env.VERSION }}.zip |
81 | 95 | rm utbot-intellij-${{ env.VERSION }}.zip |
82 | 96 |
|
83 | 97 | - name: Archive UTBot IntelliJ IDEA plugin |
| 98 | + if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }} |
84 | 99 | uses: actions/upload-artifact@v3 |
85 | 100 | with: |
86 | 101 | name: utbot-intellij-${{ env.VERSION }} |
|
90 | 105 | run: | |
91 | 106 | cd utbot-cli |
92 | 107 | gradle clean build --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g -PsemVer=${{ env.VERSION }} |
93 | | - |
| 108 | +
|
94 | 109 | - name: Archive UTBot CLI |
| 110 | + if: ${{ inputs.upload-artifact == 'true' && matrix.configuration.plugin_type == 'IC' }} |
95 | 111 | uses: actions/upload-artifact@v3 |
96 | 112 | with: |
97 | 113 | name: utbot-cli-${{ env.VERSION }} |
|
0 commit comments