|
1 | 1 | name: 'Build Sonar Python' |
2 | 2 | description: 'Build both public and private modules of sonar-python' |
3 | | -outputs: |
4 | | - build-number: |
5 | | - description: 'The build number used' |
6 | | - value: ${{ steps.config.outputs.build-number }} |
| 3 | + |
7 | 4 | runs: |
8 | 5 | using: 'composite' |
9 | 6 | steps: |
10 | 7 | - name: Configure sonar-python project |
11 | 8 | uses: ./.github/actions/config-sonar-python |
12 | | - id: config |
13 | | - with: |
14 | | - build-number: ${{ inputs.build-number }} |
15 | 9 |
|
16 | | - - name: Build public module with maven |
17 | | - uses: SonarSource/ci-github-actions/build-maven@7fea21c7155e8f0d5d429c1af625d851a6fadc3d # master, 13.10.2025 |
| 10 | + - name: Build public and private modules |
| 11 | + uses: SonarSource/ci-github-actions/build-maven@f1d7e9107578478801454495c63078f85f9f5615 # 1.2.1-BUILD-9723 |
| 12 | + id: build |
18 | 13 | with: |
19 | | - artifactory-deploy-repo: "sonarsource-public-qa" |
20 | | - maven-args: "-DskipTests=true -Dsonar.skip=true -P-typeshed_serializer" |
| 14 | + artifactory-deploy-repo: 'sonarsource-public-qa' |
| 15 | + maven-args: '-DskipTests=true -Dsonar.skip=true -P-typeshed_serializer -Dartifactory.publish.artifacts=false' |
21 | 16 | deploy-pull-request: true |
22 | 17 | sonar-platform: none |
| 18 | + cache-cleanup: false |
| 19 | + |
| 20 | + - uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # 3.1.0 |
| 21 | + id: secrets |
| 22 | + with: |
| 23 | + secrets: | |
| 24 | + development/artifactory/token/{REPO_OWNER_NAME_DASH}-public-deployer access_token | ARTIFACTORY_DEPLOY_ACCESS_TOKEN; |
| 25 | + development/artifactory/token/{REPO_OWNER_NAME_DASH}-qa-deployer access_token | ARTIFACTORY_PRIVATE_DEPLOY_ACCESS_TOKEN; |
| 26 | + - name: Artifacts upload |
| 27 | + shell: bash |
23 | 28 | env: |
24 | | - IS_COMMUNITY: true |
25 | | - BUILD_NUMBER: ${{ steps.config.outputs.build-number }} |
| 29 | + ARTIFACTORY_DEPLOY_REPO: 'sonarsource-public-qa' |
| 30 | + ARTIFACTORY_PRIVATE_DEPLOY_REPO: 'sonarsource-private-qa' |
| 31 | + ARTIFACTORY_DEPLOY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_DEPLOY_ACCESS_TOKEN }} |
| 32 | + ARTIFACTORY_PRIVATE_DEPLOY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_PRIVATE_DEPLOY_ACCESS_TOKEN }} |
| 33 | + INSTALLED_ARTIFACTS: ${{ steps.build.outputs.installed-artifacts }} |
| 34 | + run: ${GITHUB_ACTION_PATH}/deploy-artifacts.sh |
26 | 35 |
|
27 | | - - name: Remove .actions folder and make repository shallow for next steps |
| 36 | + - name: Cleanup Maven repository before caching |
28 | 37 | shell: bash |
29 | 38 | run: | |
30 | | - echo "Making repository shallow" |
31 | | - # BUILD-9065 will fix this, making this step redundant |
32 | | - # git pull fails because we're not on a branch, but it still makes the repo shallow again |
33 | | - git pull --depth 1 || true |
34 | | -
|
35 | | - # This step is needed because build-maven removes the .m2 folder, removing the built jar files of the public modules. |
36 | | - # This re-builds the public modules so the private modules will find them. |
37 | | - # See BUILD-9394 for details |
38 | | - echo "Build public module with maven as build-maven cleans up after itself" |
39 | | - IS_COMMUNITY=true mvn install -DskipTests -DskipTypeshed |
40 | | -
|
41 | | - - name: Build private module with maven |
42 | | - uses: SonarSource/ci-github-actions/build-maven@7fea21c7155e8f0d5d429c1af625d851a6fadc3d # master, 13.10.2025 |
43 | | - with: |
44 | | - artifactory-deploy-repo: "sonarsource-private-qa" |
45 | | - maven-args: "-DskipTests=true -Dsonar.skip=true -P-typeshed_serializer" |
46 | | - deploy-pull-request: true |
47 | | - working-directory: private |
48 | | - sonar-platform: none |
49 | | - env: |
50 | | - BUILD_NUMBER: ${{ steps.config.outputs.build-number }} |
51 | | - MAVEN_ARGS: "-Dsonar.skip=true" |
| 39 | + rm -rf "$MAVEN_CONFIG/repository/org/sonarsource/" |
| 40 | + rm -rf "$MAVEN_CONFIG/repository/com/sonarsource/" |
| 41 | + /usr/bin/find "$MAVEN_CONFIG/repository" -name resolver-status.properties -delete |
0 commit comments