Skip to content

Commit 748cec8

Browse files
committed
оптимизация
1 parent 08feaf2 commit 748cec8

2 files changed

Lines changed: 29 additions & 14 deletions

File tree

.github/workflows/night_build.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,24 @@ jobs:
2121
uses: actions/checkout@v6
2222
with:
2323
ref: nigth_build
24-
- name: Set up JDK
25-
uses: actions/setup-java@v5
24+
- name: Download Artifact
25+
uses: actions/download-artifact@v4
2626
with:
27-
java-version: 17
28-
distribution: 'adopt'
29-
- name: Build with Gradle
30-
run: ./gradlew build
31-
- name: Save file name
32-
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+
3333
- name: Save current date
3434
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
35+
3536
- name: Deploy build
3637
uses: WebFreak001/deploy-nightly@v3.2.0
3738
with:
38-
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
39-
release_id: 51033599 # same as above (id can just be taken out the upload_url, it's used to find old releases)
40-
asset_path: ./build/libs/${{ env.PLUGIN_FILE_NAME }} # path to archive to upload
41-
asset_name: sonar-communitybsl-plugin-nightly-${{ env.PLUGIN_CURRENT_DATE }}.jar # name, format is "-nightly-20210101"
42-
asset_content_type: application/java-archive # required by GitHub API
43-
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
jobs:
88
integration-test:
99
runs-on: ubuntu-latest
10+
outputs:
11+
plugin_file_name: ${{ steps.set_plugin_info.outputs.plugin_file_name }}
12+
1013
steps:
1114
- uses: actions/checkout@v6
1215

@@ -20,9 +23,20 @@ jobs:
2023
- name: Build Plugin
2124
run: ./gradlew clean jar
2225

26+
- name: Save Artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: sonar-plugin-jar
30+
path: build/libs/*.jar
31+
32+
- id: set_plugin_info # Добавляем ID, чтобы потом обратиться к outputs этого шага
2333
- name: Start SonarQube server
2434
run: |
2535
PLUGIN_JAR=$(find build/libs -name "*.jar" ! -name "*-sources.jar" | head -n 1)
36+
37+
FILE_NAME=$(basename $PLUGIN_JAR)
38+
echo "plugin_file_name=$FILE_NAME" >> $GITHUB_OUTPUT
39+
2640
docker run -d --name sonarqube -p 9000:9000 \
2741
-e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true \
2842
-v "$(pwd)/$PLUGIN_JAR:/opt/sonarqube/extensions/plugins/sonar-communitybsl-plugin.jar" \

0 commit comments

Comments
 (0)