Skip to content

Commit 99cc1c8

Browse files
committed
настройки ночной сборки
1 parent 4d93789 commit 99cc1c8

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

.github/workflows/night_build.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,37 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11+
run-test:
12+
uses: ./.github/workflows/pluginTest.yml
13+
# Если репозитории разные, указывается полный путь: owner/repo/.github/workflows/file.yml@branch
14+
1115
nightly:
1216
name: Night build
17+
needs: [run-test]
1318
runs-on: ubuntu-latest
1419
steps:
1520
- name: Checkout source
1621
uses: actions/checkout@v6
1722
with:
1823
ref: nigth_build
19-
- name: Set up JDK
20-
uses: actions/setup-java@v5
24+
- name: Download Artifact
25+
uses: actions/download-artifact@v4
2126
with:
22-
java-version: 21
23-
distribution: 'adopt'
24-
- name: Build with Gradle
25-
run: ./gradlew build
26-
- name: Save file name
27-
run: echo "PLUGIN_FILE_NAME=$(ls -t ./build/libs | head -1)" >> $GITHUB_ENV
27+
name: sonar-plugin-jar
28+
path: build/libs
29+
30+
- name: Restore file name
31+
run: echo "PLUGIN_FILE_NAME=${{ needs.run-test.outputs.plugin_file_name }}" >> $GITHUB_ENV
32+
2833
- name: Save current date
2934
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
35+
3036
- name: Deploy build
3137
uses: WebFreak001/deploy-nightly@v3.2.0
3238
with:
33-
upload_url: https://uploads.github.com/repos/1c-syntax/sonar-bsl-plugin-community/releases/51033599/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part
34-
release_id: 51033599 # same as above (id can just be taken out the upload_url, it's used to find old releases)
35-
asset_path: ./build/libs/${{ env.PLUGIN_FILE_NAME }} # path to archive to upload
36-
asset_name: sonar-communitybsl-plugin-nightly-${{ env.PLUGIN_CURRENT_DATE }}.jar # name, format is "-nightly-20210101"
37-
asset_content_type: application/java-archive # required by GitHub API
38-
max_releases: 7 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
39+
upload_url: https://uploads.github.com/repos/1c-syntax/sonar-bsl-plugin-community/releases/51033599/assets{?name,label}
40+
release_id: 51033599
41+
asset_path: ./build/libs/${{ env.PLUGIN_FILE_NAME }}
42+
asset_name: sonar-communitybsl-plugin-nightly-${{ env.PLUGIN_CURRENT_DATE }}.jar
43+
asset_content_type: application/java-archive
44+
max_releases: 7

.github/workflows/pluginTest.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
name: Plugin Integration Test
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_call: # Позволяет вызывать этот воркфлоу из других файлов
5+
outputs:
6+
plugin_file_name:
7+
description: "The name of the built jar file"
8+
value: ${{ jobs.integration-test.outputs.plugin_file_name }}
9+
10+
workflow_dispatch: # Позволяет запускать вручную
411

512
jobs:
613
integration-test:
714
runs-on: ubuntu-latest
15+
outputs:
16+
plugin_file_name: ${{ steps.set_plugin_info.outputs.plugin_file_name }}
17+
818
steps:
919
- uses: actions/checkout@v6
1020

@@ -18,9 +28,20 @@ jobs:
1828
- name: Build Plugin
1929
run: ./gradlew clean jar
2030

21-
- name: Start SonarQube server
31+
- name: Save Artifact
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: sonar-plugin-jar
35+
path: build/libs/*.jar
36+
37+
- id: set_plugin_info # Добавляем ID, чтобы потом обратиться к outputs этого шага
38+
name: Start SonarQube server
2239
run: |
2340
PLUGIN_JAR=$(find build/libs -name "*.jar" ! -name "*-sources.jar" | head -n 1)
41+
42+
FILE_NAME=$(basename $PLUGIN_JAR)
43+
echo "plugin_file_name=$FILE_NAME" >> $GITHUB_OUTPUT
44+
2445
docker run -d --name sonarqube -p 9000:9000 \
2546
-e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true \
2647
-v "$(pwd)/$PLUGIN_JAR:/opt/sonarqube/extensions/plugins/sonar-communitybsl-plugin.jar" \

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ val commonmarkVersion = "0.27.1"
2727
dependencies {
2828
compileOnly("org.sonarsource.api.plugin", "sonar-plugin-api", "11.3.0.2824")
2929

30-
implementation("io.github.1c-syntax", "bsl-language-server", "0.28.5") {
30+
implementation("io.github.1c-syntax", "bsl-language-server", "0.+") {
3131
exclude("com.contrastsecurity", "java-sarif")
3232
exclude("io.sentry", "sentry-logback")
3333
exclude("info.picocli", "picocli-spring-boot-starter")

0 commit comments

Comments
 (0)