Skip to content

Commit 4650db7

Browse files
committed
PYSCAN-38: Publish PR artifacts to Repox (#32)
1 parent 473ec06 commit 4650db7

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/build-pr.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ jobs:
127127
with:
128128
python-version: |
129129
3.12
130-
cache: "poetry"
130+
- name: Install Poetry
131+
run: |
132+
pipx install poetry
131133
- name: Install its dependencies
132134
working-directory: ./its
133135
env:
@@ -142,3 +144,37 @@ jobs:
142144
working-directory: ./its
143145
run: |
144146
poetry run pytest
147+
publish:
148+
runs-on: ubuntu-latest
149+
permissions:
150+
id-token: write # required by SonarSource/vault-action-wrapper
151+
contents: read # required by actions/checkout
152+
strategy:
153+
fail-fast: false
154+
steps:
155+
- name: Get vault secrets
156+
id: secrets
157+
uses: SonarSource/vault-action-wrapper@v2
158+
with:
159+
secrets: |
160+
development/artifactory/token/{REPO_OWNER_NAME_DASH}-qa-deployer access_token | ARTIFACTORY_PASSWORD_QA;
161+
- uses: actions/checkout@v3
162+
- name: Set up Python
163+
uses: actions/setup-python@v4
164+
with:
165+
python-version: |
166+
3.12
167+
- name: Install Poetry
168+
run: |
169+
pipx install poetry
170+
- name: Configure pypi repo
171+
run: poetry config repositories.sonarsource https://repox.jfrog.io/artifactory/api/pypi/sonarsource-pypi-builds
172+
- name: Build and publish
173+
env:
174+
ARTIFACTORY_PYPI_DEPLOYER_USER: vault-SonarSource-sonar-scanner-python-qa-deployer
175+
ARTIFACTORY_PYPI_DEPLOYER_API_KEY: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_PASSWORD_QA }}
176+
run: |
177+
poetry version patch
178+
poetry version $(poetry version -s).dev${{ github.run_number }}
179+
poetry build
180+
poetry publish -r sonarsource --username $ARTIFACTORY_PYPI_DEPLOYER_USER --password $ARTIFACTORY_PYPI_DEPLOYER_API_KEY --verbose

0 commit comments

Comments
 (0)