Skip to content

Commit 4e60785

Browse files
committed
rider plugin workflow
1 parent 28a1fd6 commit 4e60785

File tree

2 files changed

+169
-136
lines changed

2 files changed

+169
-136
lines changed
Lines changed: 88 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,88 @@
1-
# This is a basic workflow that is manually triggered
2-
3-
name: Manual workflow
4-
5-
# Controls when the action will run. Workflow runs when manually triggered using the UI
6-
# or API.
7-
on:
8-
workflow_dispatch:
9-
# Inputs the workflow accepts.
10-
inputs:
11-
name:
12-
# Friendly description to be shown in the UI instead of 'name'
13-
description: 'It adds minor release indicator to version.'
14-
# Default value if no value is explicitly provided
15-
default: 'World'
16-
# Input has to be provided for the workflow to run
17-
required: true
18-
19-
env:
20-
# Environment variable setting gradle options.
21-
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
22-
23-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
24-
jobs:
25-
# This workflow contains a single job called "greet"
26-
public_rider_plugin:
27-
# The type of runner that the job will run on
28-
runs-on: ubuntu-20.04
29-
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
30-
31-
# Steps represent a sequence of tasks that will be executed as part of the job
32-
steps:
33-
# Runs a single command using the runners shell
34-
- name: Print environment variables
35-
run: printenv
36-
37-
- uses: actions/checkout@v3
38-
39-
- name: Set environment variables
40-
run: |
41-
# "You can make an environment variable available to any subsequent steps in a workflow job by
42-
# defining or updating the environment variable and writing this to the GITHUB_ENV environment file."
43-
echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV
44-
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV
45-
46-
- name: Set production version
47-
if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }}
48-
run: |
49-
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
50-
51-
- name: Set version for minor release
52-
if: ${{ github.event.inputs.minor-release != 'none' }}
53-
run: |
54-
echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV
55-
56-
- name: Create version with postfix
57-
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
58-
run:
59-
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
60-
61-
- name: Build UTBot Rider plugin
62-
run: |
63-
gradle clean :utbot-rider:buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} -PincludeRiderInBuild=true
64-
cd utbot-rider/build/distributions
65-
unzip utbot-rider-$PP env.VERSION }}.zip
66-
rm utbot-rider-${{ env.VERSION}}.zip
67-
68-
- name: Archive UTBot Rider plugin
69-
uses: actions/upload-artifact@v3
70-
with:
71-
name: utbot-rider-${{ env.VERSION }}
72-
path: utbot-rider/build/distributions/*
73-
1+
# This is a basic workflow that is manually triggered
2+
3+
name: Publish Rider plugin
4+
5+
# Controls when the action will run. Workflow runs when manually triggered using the UI
6+
# or API.
7+
on:
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
minor-release:
12+
type: choice
13+
description: "It adds minor release indicator to version."
14+
required: true
15+
default: 'none'
16+
options:
17+
- 'none'
18+
- '1'
19+
- '2'
20+
- '3'
21+
- '4'
22+
23+
version-postfix:
24+
type: choice
25+
description: "It adds alpha or beta postfix to version."
26+
required: true
27+
default: no-postfix-prod
28+
options:
29+
- no-postfix-prod
30+
- no-postfix
31+
- alpha
32+
- beta
33+
34+
env:
35+
# Environment variable setting gradle options.
36+
GRADLE_OPTS: "-XX:MaxHeapSize=2048m -Dorg.gradle.jvmargs='-XX:MaxHeapSize=2048m -XX:MaxPermSize=512m -Dorg.gradle.daemon=false' -Dorg.gradle.daemon=false"
37+
38+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
39+
jobs:
40+
# This workflow contains a single job called "greet"
41+
public_rider_plugin:
42+
# The type of runner that the job will run on
43+
runs-on: ubuntu-20.04
44+
container: unittestbot/java-env:java11-zulu-jdk-gradle7.4.2-kotlinc1.7.0
45+
46+
# Steps represent a sequence of tasks that will be executed as part of the job
47+
steps:
48+
# Runs a single command using the runners shell
49+
- name: Print environment variables
50+
run: printenv
51+
52+
- uses: actions/checkout@v3
53+
54+
- name: Set environment variables
55+
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+
echo "VERSION="$(date +%Y).$(date +%-m).${GITHUB_RUN_NUMBER}"" >> $GITHUB_ENV
59+
echo "POSTFIX=${{ github.event.inputs.version-postfix }}" >> $GITHUB_ENV
60+
61+
- name: Set production version
62+
if: ${{ github.event.inputs.version-postfix == 'no-postfix-prod' || github.event.inputs.version-postfix == 'alpha' || github.event.inputs.version-postfix == 'beta' }}
63+
run: |
64+
echo "VERSION="$(date +%Y).$(date +%-m)"" >> $GITHUB_ENV
65+
66+
- name: Set version for minor release
67+
if: ${{ github.event.inputs.minor-release != 'none' }}
68+
run: |
69+
echo "VERSION=${{ env.VERSION }}.${{ github.event.inputs.minor-release }}" >> $GITHUB_ENV
70+
71+
- name: Create version with postfix
72+
if: ${{ (env.POSTFIX == 'alpha') || (env.POSTFIX == 'beta') }}
73+
run:
74+
echo "VERSION=${{ env.VERSION }}-${{ env.POSTFIX }}" >> $GITHUB_ENV
75+
76+
- name: Build UTBot Rider plugin
77+
run: |
78+
gradle clean :utbot-rider:buildPlugin --no-daemon -PsemVer=${{ env.VERSION }} -PincludeRiderInBuild=true
79+
cd utbot-rider/build/distributions
80+
unzip utbot-rider-$PP env.VERSION }}.zip
81+
rm utbot-rider-${{ env.VERSION}}.zip
82+
83+
- name: Archive UTBot Rider plugin
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: utbot-rider-${{ env.VERSION }}
87+
path: utbot-rider/build/distributions/*
88+

utbot-rider/build.gradle.kts

Lines changed: 81 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,81 @@
1-
val semVer: String? by rootProject
2-
val rdVersion: String? by rootProject
3-
4-
plugins {
5-
id("org.jetbrains.intellij") version "1.7.0"
6-
}
7-
8-
intellij {
9-
type.set("RD")
10-
version.set("2022.2")
11-
}
12-
13-
dependencies {
14-
implementation(group ="com.jetbrains.rd", name = "rd-framework", version = rdVersion)
15-
implementation(group ="com.jetbrains.rd", name = "rd-core", version = rdVersion)
16-
}
17-
18-
tasks {
19-
val dotNetSdkCmdPath = projectDir.resolve("dotnet-sdk.cmd").toString()
20-
21-
compileKotlin {
22-
kotlinOptions {
23-
jvmTarget = "11"
24-
freeCompilerArgs = freeCompilerArgs + listOf("-Xallow-result-return-type", "-Xsam-conversions=class")
25-
allWarningsAsErrors = false
26-
}
27-
}
28-
29-
java {
30-
sourceCompatibility = JavaVersion.VERSION_1_8
31-
targetCompatibility = JavaVersion.VERSION_11
32-
}
33-
34-
runIde {
35-
jvmArgs("-Xmx2048m")
36-
}
37-
38-
patchPluginXml {
39-
sinceBuild.set("222")
40-
untilBuild.set("222.*")
41-
version.set(semVer)
42-
}
43-
44-
val publishDotNet = create("publishDotNet") {
45-
group = "build"
46-
doLast {
47-
exec {
48-
commandLine = listOf(
49-
dotNetSdkCmdPath,
50-
"publish",
51-
projectDir.resolve("src/dotnet/UtBot/UtBot.sln").toString()
52-
)
53-
}
54-
}
55-
}
56-
57-
prepareSandbox {
58-
dependsOn(publishDotNet)
59-
from("src/dotnet/UtBot/UtBot/bin/Debug/net6.0/publish") {
60-
into("${intellij.pluginName.get()}/dotnet") }
61-
}
62-
63-
}
1+
val semVer: String? by rootProject
2+
val rdVersion: String? by rootProject
3+
4+
plugins {
5+
id("org.jetbrains.intellij") version "1.7.0"
6+
}
7+
8+
intellij {
9+
type.set("RD")
10+
version.set("2022.2")
11+
}
12+
13+
dependencies {
14+
implementation(group ="com.jetbrains.rd", name = "rd-framework", version = rdVersion)
15+
implementation(group ="com.jetbrains.rd", name = "rd-core", version = rdVersion)
16+
}
17+
18+
tasks {
19+
val dotNetSdkCmdPath = projectDir.resolve("dotnet-sdk.cmd").toString()
20+
21+
compileKotlin {
22+
kotlinOptions {
23+
jvmTarget = "11"
24+
freeCompilerArgs = freeCompilerArgs + listOf("-Xallow-result-return-type", "-Xsam-conversions=class")
25+
allWarningsAsErrors = false
26+
}
27+
}
28+
29+
java {
30+
sourceCompatibility = JavaVersion.VERSION_1_8
31+
targetCompatibility = JavaVersion.VERSION_11
32+
}
33+
34+
runIde {
35+
jvmArgs("-Xmx2048m")
36+
}
37+
38+
patchPluginXml {
39+
sinceBuild.set("222")
40+
untilBuild.set("222.*")
41+
version.set(semVer)
42+
}
43+
44+
buildSearchableOptions {
45+
enabled = false
46+
}
47+
48+
val chmodDotnet = create("chmodDotnet") {
49+
group = "build"
50+
doLast {
51+
exec {
52+
commandLine = listOf(
53+
"chmod",
54+
"+x",
55+
dotNetSdkCmdPath
56+
)
57+
}
58+
}
59+
}
60+
61+
val publishDotNet = create("publishDotNet") {
62+
dependsOn(chmodDotnet)
63+
group = "build"
64+
doLast {
65+
exec {
66+
commandLine = listOf(
67+
dotNetSdkCmdPath,
68+
"publish",
69+
projectDir.resolve("src/dotnet/UtBot/UtBot.sln").toString()
70+
)
71+
}
72+
}
73+
}
74+
75+
prepareSandbox {
76+
dependsOn(publishDotNet)
77+
from("src/dotnet/UtBot/UtBot/bin/Debug/net6.0/publish") {
78+
into("${intellij.pluginName.get()}/dotnet") }
79+
}
80+
81+
}

0 commit comments

Comments
 (0)