Skip to content

Commit 5a0f5cc

Browse files
authored
Feature/conveyor ci (#21)
* [feature] Добавить сборщик conveyor * [bugfix] Исправить автотесты * [feature] Добавить автоматическую сборку
1 parent 3479441 commit 5a0f5cc

File tree

11 files changed

+218
-127
lines changed

11 files changed

+218
-127
lines changed

.github/workflows/linux.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.github/workflows/nightly.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Nightly build
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- feature/conveyor-ci
7+
8+
jobs:
9+
Build-Convey:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up JDK 21
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '21'
21+
distribution: 'temurin'
22+
23+
- name: Validate gradle wrappers
24+
uses: gradle/actions/wrapper-validation@v4
25+
26+
- name: Install conveyor
27+
run: |
28+
wget https://downloads.hydraulic.dev/conveyor/conveyor-18.0-linux-amd64.tar.gz
29+
tar -xzf conveyor-18.0-linux-amd64.tar.gz
30+
chmod +x conveyor-18.0/bin/conveyor
31+
echo "$(pwd)/conveyor-18.0/bin" >> $GITHUB_PATH
32+
33+
- name: Build and push with conveyor
34+
uses: coactions/setup-xvfb@v1
35+
with:
36+
run: ./gradlew conveyCI
37+
env:
38+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
40+
41+
- name: Upload artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: windows-msix
45+
path: |
46+
desktop/build/packages/*.msix
47+
desktop/build/packages/*.crt
48+
desktop/build/packages/*.appinstaller
49+
desktop/build/packages/*.ps1
50+
LICENSE*
51+
52+
- name: Upload artifacts
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: windows-portable
56+
path: |
57+
desktop/build/packages/*windows*.zip
58+
LICENSE*
59+
60+
- name: Upload artifacts
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: linux-portable
64+
path: |
65+
desktop/build/packages/*.tar.gz
66+
LICENSE*
67+
68+
- name: Upload artifacts
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: linux-deb
72+
path: |
73+
desktop/build/packages/*.deb
74+
LICENSE*

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "v*.*.*"
6+
7+
jobs:
8+
Build-Convey:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up JDK 21
17+
uses: actions/setup-java@v4
18+
with:
19+
java-version: '21'
20+
distribution: 'temurin'
21+
22+
- name: Validate gradle wrappers
23+
uses: gradle/actions/wrapper-validation@v4
24+
25+
- name: Extract version from tag
26+
uses: damienaicheh/extract-version-from-tag-action@v1.3.0
27+
28+
- name: Set version
29+
run: echo "VERSION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}" >> $GITHUB_ENV
30+
31+
- name: Install conveyor
32+
run: |
33+
wget https://downloads.hydraulic.dev/conveyor/conveyor-18.0-linux-amd64.tar.gz
34+
tar -xzf conveyor-18.0-linux-amd64.tar.gz
35+
chmod +x conveyor-18.0/bin/conveyor
36+
echo "$(pwd)/conveyor-18.0/bin" >> $GITHUB_PATH
37+
38+
- name: Build and push with conveyor
39+
uses: coactions/setup-xvfb@v1
40+
with:
41+
run: ./gradlew conveyCI
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
45+
46+
- name: Release
47+
uses: softprops/action-gh-release@v2
48+
with:
49+
files: |
50+
desktop/build/packages/big-data-scanner.appinstaller
51+
desktop/build/packages/big-data-scanner.crt
52+
desktop/build/packages/big-data-scanner.exe
53+
desktop/build/packages/big-data-scanner-${{ env.VERSION }}-windows-amd64.zip
54+
desktop/build/packages/big-data-scanner-${{ env.VERSION }}.x64.msix
55+
desktop/build/packages/install.ps1
56+
desktop/build/packages/big-data-scanner-${{ env.VERSION }}-linux-amd64.tar.gz
57+
desktop/build/packages/llc-detecticum-big-data-scanner_${{ env.VERSION }}_amd64.deb
58+
LICENSE.txt
59+
LICENSE.en.txt
60+
61+
62+
63+

.github/workflows/tests.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,16 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Set up JDK 17
16+
- name: Set up JDK 21
1717
uses: actions/setup-java@v4
1818
with:
19-
java-version: '17'
19+
java-version: '21'
2020
distribution: 'temurin'
2121

22-
- name: Checkout Lib
23-
uses: actions/checkout@v4
24-
with:
25-
repository: packetdima/angrydata
26-
path: lib
27-
2822
- name: Validate gradle wrappers
2923
uses: gradle/actions/wrapper-validation@v4
3024

31-
- name: List files in the working directory
32-
run: ls -R
33-
3425
- name: Tests with Gradle Wrapper and XVFB
3526
uses: coactions/setup-xvfb@v1
3627
with:
3728
run: ./gradlew allTests --no-daemon
38-
39-
Windows:
40-
runs-on: windows-latest
41-
permissions:
42-
contents: read
43-
44-
steps:
45-
- uses: actions/checkout@v4
46-
- name: Set up JDK 17
47-
uses: actions/setup-java@v4
48-
with:
49-
java-version: '17'
50-
distribution: 'temurin'
51-
52-
- name: Validate gradle wrappers
53-
uses: gradle/actions/wrapper-validation@v4
54-
55-
- name: Tests with Gradle Wrapper
56-
run: ./gradlew allTests

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
alias(libs.plugins.compose).apply(false)
99
alias(libs.plugins.compose.compiler).apply(false)
1010
alias(libs.plugins.kover)
11+
alias(libs.plugins.conveyor).apply(false)
1112
}
1213

1314
val dummyAttribute = Attribute.of("ru.packetdima", String::class.java)

desktop/build.gradle.kts

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,38 @@ plugins {
66
alias(libs.plugins.compose)
77
alias(libs.plugins.compose.compiler)
88
alias(libs.plugins.kover)
9+
alias(libs.plugins.conveyor)
910
}
1011

1112
kotlin {
1213
jvm("desktop")
14+
jvmToolchain {
15+
languageVersion.set(JavaLanguageVersion.of(21))
16+
vendor.set(JvmVendorSpec.ADOPTIUM)
17+
}
1318
sourceSets {
14-
val commonMain by getting {
15-
dependencies {
19+
val desktopMain by getting
20+
val desktopTest by getting
21+
commonMain.dependencies {
1622
implementation(project(":shared"))
1723
implementation(libs.logging.oshai)
1824
implementation(libs.logging.logback)
1925
implementation(libs.logging.log4j.core)
2026
implementation(libs.console.progressbar)
2127
}
28+
29+
desktopMain.dependencies {
30+
implementation(compose.desktop.currentOs)
31+
implementation(libs.ktor.server.netty)
32+
implementation(libs.ktor.network)
2233
}
23-
val desktopMain by getting {
24-
dependencies {
25-
implementation(compose.desktop.currentOs)
26-
implementation(libs.ktor.server.netty)
27-
implementation(libs.ktor.network)
28-
}
29-
}
30-
val desktopTest by getting {
31-
dependencies {
32-
implementation(compose.desktop.uiTestJUnit4)
33-
implementation(libs.koin.core)
34-
implementation(libs.koin.test.junit4)
35-
}
34+
35+
desktopTest.dependencies {
36+
implementation(compose.desktop.uiTestJUnit4)
37+
implementation(libs.koin.core)
38+
implementation(libs.koin.test.junit4)
3639
}
40+
3741
// Adds common test dependencies
3842
commonTest.dependencies {
3943
implementation(kotlin("test"))
@@ -44,6 +48,13 @@ kotlin {
4448
}
4549
}
4650

51+
dependencies {
52+
linuxAmd64(compose.desktop.linux_x64)
53+
macAmd64(compose.desktop.macos_x64)
54+
macAarch64(compose.desktop.macos_arm64)
55+
windowsAmd64(compose.desktop.windows_x64)
56+
}
57+
4758
compose.desktop {
4859
application {
4960
mainClass = "ru.packetdima.datascanner.MainKt"
@@ -91,6 +102,21 @@ compose.desktop {
91102
}
92103
}
93104

105+
tasks.register<Exec>("convey") {
106+
val dir = layout.buildDirectory.dir("packages")
107+
outputs.dir(dir)
108+
environment.put("CONVEYOR_AGREE_TO_LICENSE", "1")
109+
commandLine("conveyor", "make", "--output-dir", dir.get(), "site")
110+
dependsOn("build", "writeConveyorConfig")
111+
}
112+
tasks.register<Exec>("conveyCI") {
113+
val dir = layout.buildDirectory.dir("packages")
114+
outputs.dir(dir)
115+
environment.put("CONVEYOR_AGREE_TO_LICENSE", "1")
116+
commandLine("conveyor", "-f", "ci.conveyor.conf", "make", "--output-dir", dir.get(), "site")
117+
dependsOn("build", "writeConveyorConfig")
118+
}
119+
94120
tasks.create("printVersion") {
95121
doLast {
96122
print(version)
@@ -108,4 +134,11 @@ tasks.register("getOS") {
108134
}
109135
}"
110136
)
137+
}
138+
139+
configurations.all {
140+
attributes {
141+
// https://github.com/JetBrains/compose-jb/issues/1404#issuecomment-1146894731
142+
attribute(Attribute.of("ui", String::class.java), "awt")
143+
}
111144
}

desktop/ci.conveyor.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include required("conveyor.conf")
2+
3+
app {
4+
signing-key = ${env.SIGNING_KEY}
5+
}

0 commit comments

Comments
 (0)