|
| 1 | +--- |
| 2 | +name: Configure Poetry for Windows |
| 3 | +description: GitHub Action to configure a poetry project for windows runner |
| 4 | + |
| 5 | +outputs: |
| 6 | + BUILD_NUMBER: |
| 7 | + description: The build number, incremented or reused if already cached |
| 8 | + value: ${{ steps.get_build_number.outputs.BUILD_NUMBER }} |
| 9 | + |
| 10 | +runs: |
| 11 | + using: composite |
| 12 | + steps: |
| 13 | + - name: Set build parameters |
| 14 | + shell: bash |
| 15 | + env: |
| 16 | + ARTIFACTORY_READER_ROLE: private-reader |
| 17 | + run: | |
| 18 | + echo "ARTIFACTORY_READER_ROLE=${ARTIFACTORY_READER_ROLE}" >> "$GITHUB_ENV" |
| 19 | + - uses: SonarSource/ci-github-actions/get-build-number@v1 |
| 20 | + id: get_build_number |
| 21 | + - name: Cache local Poetry cache |
| 22 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 23 | + with: |
| 24 | + path: ${{ github.workspace }}/.cache/pypoetry |
| 25 | + key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }} |
| 26 | + restore-keys: poetry-${{ runner.os }}- |
| 27 | + - name: Vault |
| 28 | + # yamllint disable rule:line-length |
| 29 | + id: secrets |
| 30 | + uses: SonarSource/vault-action-wrapper@320bd31b03e5dacaac6be51bbbb15adf7caccc32 # 3.1.0 |
| 31 | + with: |
| 32 | + secrets: | |
| 33 | + development/artifactory/token/{REPO_OWNER_NAME_DASH}-${{ env.ARTIFACTORY_READER_ROLE }} access_token | ARTIFACTORY_ACCESS_TOKEN; |
| 34 | + # yamllint enable rule:line-length |
| 35 | + - name: Install JFrog |
| 36 | + id: install_jfrog |
| 37 | + shell: pwsh |
| 38 | + run: | |
| 39 | + Start-Process -Wait -Verb RunAs powershell '-NoProfile iwr https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/[RELEASE]/jfrog-cli-windows-amd64/jf.exe -OutFile $env:SYSTEMROOT\system32\jf.exe' |
| 40 | + jf intro |
| 41 | + - name: Install Poetry |
| 42 | + id: install_poetry |
| 43 | + shell: bash |
| 44 | + run: | |
| 45 | + pip install poetry==2.2.1 |
| 46 | + - name: Config Poetry |
| 47 | + id: config |
| 48 | + shell: bash |
| 49 | + env: |
| 50 | + ARTIFACTORY_URL: https://repox.jfrog.io/artifactory |
| 51 | + ARTIFACTORY_PYPI_REPO: sonarsource-pypi |
| 52 | + ARTIFACTORY_ACCESS_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).ARTIFACTORY_ACCESS_TOKEN }} |
| 53 | + run: | |
| 54 | + ${GITHUB_ACTION_PATH}/../../scripts/config-poetry.sh |
| 55 | +
|
0 commit comments