From a4726ded2430adffae31ecb0b9602b2370af0b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 00:43:35 -0400 Subject: [PATCH 1/8] [DEVOPS-678] remove now unused workflow to build a conda recipe we use rattler build instead --- .../reusable-python-publish_conda_package.yml | 162 ------------------ 1 file changed, 162 deletions(-) delete mode 100644 .github/workflows/reusable-python-publish_conda_package.yml diff --git a/.github/workflows/reusable-python-publish_conda_package.yml b/.github/workflows/reusable-python-publish_conda_package.yml deleted file mode 100644 index ac3b043c..00000000 --- a/.github/workflows/reusable-python-publish_conda_package.yml +++ /dev/null @@ -1,162 +0,0 @@ -name: Publish Conda package to Artifactory - -on: - workflow_call: - inputs: - package-name: - description: 'Name of the package to build' - required: true - type: string - python-version: - description: 'Python version to use (eg: 3.10)' - required: true - type: string - lfs: - description: 'Boolean to indicate if Github LFS is needed' - required: false - type: boolean - default: true - virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-conda-dev"])' - required: true - type: string - os: - description: 'OS to build against (eg. "ubuntu-latest")' - required: false - type: string - default: 'ubuntu-latest' - timeout-minutes: - description: 'Timeout in minutes for the job' - required: false - type: number - default: 20 - - secrets: - JFROG_ARTIFACTORY_URL: - description: 'JFrog Artifactory URL' - required: true - JFROG_ARTIFACTORY_TOKEN: - description: 'JFrog Artifactory Token' - required: true - -defaults: - run: - shell: 'bash -l {0}' - -jobs: - build_conda_package: - name: Build package - if: ${{ github.repository_owner == 'MiraGeoscience' }} - runs-on: ${{ inputs.os }} - timeout-minutes: ${{ inputs.timeout-minutes }} - outputs: - build-dir-path: ${{ steps.build-package.outputs.build-dir-path }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - lfs: ${{ inputs.lfs }} - fetch-depth: 0 - - name: Check if there is a conda recipe - run: | - if [ -f meta.yaml ]; then - echo "Conda recipe found" - else - echo "Conda recipe not found" - exit 1 - fi - - name: Set up Python version - uses: actions/setup-python@v5 - with: - python-version: ${{ inputs.python-version }} - - uses: jfrog/setup-jfrog-cli@v4.5.6 - name: Setup JFrog CLI - env: - JF_URL: https://${{ secrets.JFROG_ARTIFACTORY_URL }} - JF_ACCESS_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} - - - name: Setup conda env - uses: mamba-org/setup-micromamba@v2 - with: - micromamba-version: 1.5.8-0 - environment-name: test_env - init-shell: bash - cache-downloads: true - post-cleanup: none - env: - PYTHONUTF8: 1 - CONDA_CHANNEL_PRIORITY: strict - - name: Add conda channel - run: | - repository_list=$(echo '${{ inputs.virtual-repo-names }}' | jq -r '.[]') - for repo_name in ${repository_list}; do - micromamba config append channels https://github:${{ secrets.JFROG_ARTIFACTORY_TOKEN }}@${{ secrets.JFROG_ARTIFACTORY_URL }}/artifactory/api/conda/${repo_name} - done - - name: Install conda build - run: | - micromamba install -y conda-build>=25.1.0 conda-verify - - name: Build package - id: build-package - run: | - conda-build . - BUILD_PATH=$(conda-build --output .) - if [[ -z ${BUILD_PATH} ]]; then - echo "No build path found" - exit 1 - fi - if [[ ! -e ${BUILD_PATH} ]]; then - echo "No build at ${BUILD_PATH}" - exit 1 - fi - echo "build-path=${BUILD_PATH}" >> $GITHUB_OUTPUT - echo "build-dir-path=$(dirname ${BUILD_PATH})" >> $GITHUB_OUTPUT - - - name: Archive build artifact - uses: actions/upload-artifact@v4 - with: - name: package-build-conda - path: ${{ steps.build-package.outputs.build-path }} - retention-days: 7 - publish_package_on_artifactory: - name: Publish package - if: ${{ github.repository_owner == 'MiraGeoscience' }} - runs-on: 'ubuntu-latest' - timeout-minutes: 5 - needs: build_conda_package - strategy: - matrix: - virtual-repo-name: ${{ fromJson(inputs.virtual-repo-names) }} - steps: - - name: Download build artifact - uses: actions/download-artifact@v4 - with: - name: package-build-conda - path: ${{ needs.build_conda_package.outputs.build-dir-path }} - - name: Publish package to Artifactory - uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-publish_to_artifactory@main - with: - build-dir-path: ${{ needs.build_conda_package.outputs.build-dir-path }} - artifactory-dir-path: ${{ matrix.virtual-repo-name}}/noarch - JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} - JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} - add_release_asset: - name: Add release asset - runs-on: 'ubuntu-latest' - timeout-minutes: 5 - needs: publish_package_on_artifactory - steps: - - name: Get draft release - uses: MiraGeoscience/CI-tools/.github/actions/reusable-get_draft_release@main - id: get-draft-release - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Download build artifact - uses: actions/download-artifact@v4 - with: - name: package-build-conda - path: download-artifact - - name: Upload release asset - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_REPO: ${{ github.repository }} - run: gh release upload --clobber ${{ steps.get-draft-release.outputs.release-tag }} download-artifact/* From 8b5ce6665e15c5de77e510815e39061b6a3a855d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 00:46:09 -0400 Subject: [PATCH 2/8] [DEVOPS-678] accept conda channels as input besides repo names --- ...eusable-python-publish_rattler_package.yml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index ce6cb029..5c4c3f49 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -16,12 +16,16 @@ on: required: false type: boolean default: true + conda-channels: + description: 'List of conda channels to pull from (e.g. ["conda-forge", "pytorch"])' + required: true + type: string source-repo-names: - description: 'Matrix of repository names to publish on (eg. ["public-conda-dev-local", "conda-forge-dev-remote"])' + description: 'List of repository names to pull from (e.g. ["geology-conda-dev", "geophysics-conda-dev"])' required: true type: string publish-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-conda-dev"])' + description: 'List of repository names to publish on (e.g. ["public-conda-dev"])' required: true type: string os: @@ -72,14 +76,9 @@ jobs: BUILDS_ARGS="" RATTLER_AUTH_FILE=${{ runner.temp }}/credentials.json - repository_list=$(echo '${{ inputs.source-repo-names }}' | jq -r '.[]') - repository_count=$(echo '${{ inputs.source-repo-names }}' | jq '. | length') - - # Check if there is more than one element - if [ "$repository_count" -ge 1 ]; then + repository_list=$(echo '${{ inputs.source-repo-names }}' | jq -r '.[]' | xargs) + if [ -n "$repository_list" ]; then echo '{"${{ secrets.JFROG_ARTIFACTORY_URL }}": {"BasicHTTP": {"username": "github", "password":"${{ secrets.JFROG_ARTIFACTORY_TOKEN }}"} } }' > "$RATTLER_AUTH_FILE" - else - BUILDS_ARGS=" --channel conda-forge" fi # Loop through the repository names and add them to the command @@ -87,6 +86,11 @@ jobs: BUILDS_ARGS+=" --channel https://${{ secrets.JFROG_ARTIFACTORY_URL }}/artifactory/api/conda/${repo_name}" done + channnel_list=$(echo '${{ inputs.conda-channels }}' | jq -r '.[]' | xargs) + for channel_name in ${channel_list}; do + BUILDS_ARGS+=" --channel ${channel_name}" + done + BUILDS_ARGS+=" --output-dir ${{ runner.temp }}/output" BUILDS_ARGS+=" --channel-priority disabled" @@ -123,7 +127,7 @@ jobs: needs: build_rattler_package strategy: matrix: - virtual-repo-name: ${{ fromJson(inputs.publish-repo-names) }} + publish-repo-name: ${{ fromJson(inputs.publish-repo-names) }} steps: - name: Download build artifact uses: actions/download-artifact@v4 @@ -134,7 +138,7 @@ jobs: uses: MiraGeoscience/CI-tools/.github/actions/reusable-python-publish_to_artifactory@main with: build-dir-path: 'build-dir/noarch' - artifactory-dir-path: ${{ matrix.virtual-repo-name}}/noarch + artifactory-dir-path: ${{ matrix.publish-repo-name}}/noarch JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} add_release_asset: From db93e95223d1b8bfffff468707eecfa7335b926a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 00:47:47 -0400 Subject: [PATCH 3/8] [DEVOPS-678] use repo.prefix.dev instead of anaconda --- .../workflows/reusable-python-publish_rattler_package.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index 5c4c3f49..87421b72 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -51,6 +51,11 @@ defaults: run: shell: 'bash -l {0}' +env: + # cover for both conda and mamba + CONDA_CHANNEL_ALIAS: https://repo.prefix.dev + MAMBA_CHANNEL_ALIAS: https://repo.prefix.dev + jobs: build_rattler_package: name: Build package with rattler From fb8c20f7ffe62e1be7d1124ca086c52a8df7bb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 00:48:27 -0400 Subject: [PATCH 4/8] [DEVOPS-678] use flexible channel priority --- .github/workflows/reusable-python-publish_rattler_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index 87421b72..7e569516 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -97,7 +97,7 @@ jobs: done BUILDS_ARGS+=" --output-dir ${{ runner.temp }}/output" - BUILDS_ARGS+=" --channel-priority disabled" + BUILDS_ARGS+=" --channel-priority flexible" echo "RATTLER_AUTH_FILE=${RATTLER_AUTH_FILE}" >> "$GITHUB_ENV" echo "BUILDS_ARGS=$BUILDS_ARGS" >> "$GITHUB_ENV" From e83dfa5b18b1d863928444f1d6f8dab0385aca7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 00:59:56 -0400 Subject: [PATCH 5/8] [DEVOPS-678] minor: adjust input parameter descriptions --- .github/workflows/reusable-jira-issue_to_jira.yml | 2 +- .github/workflows/reusable-pre_commit.yml | 2 +- .../reusable-python-build_poetry_package.yml | 7 +++---- .../reusable-python-build_setuptools_package.yml | 7 +++---- .../reusable-python-publish_pypi_package.yml | 8 ++++---- .../reusable-python-publish_rattler_package.yml | 4 ++-- .github/workflows/reusable-python-pytest.yml | 12 ++++++------ .../reusable-python-release_conda_assets.yml | 2 +- .../reusable-python-release_pypi_assets.yml | 2 +- .../workflows/reusable-python-static_analysis.yml | 8 ++++---- 10 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/reusable-jira-issue_to_jira.yml b/.github/workflows/reusable-jira-issue_to_jira.yml index be277d58..fe05e46a 100644 --- a/.github/workflows/reusable-jira-issue_to_jira.yml +++ b/.github/workflows/reusable-jira-issue_to_jira.yml @@ -20,7 +20,7 @@ on: required: true type: string components: - description: 'JIRA components (eg. [{"name": "geoh5py"}])' + description: 'JIRA components (e.g. [{"name": "geoh5py"}])' required: false type: string diff --git a/.github/workflows/reusable-pre_commit.yml b/.github/workflows/reusable-pre_commit.yml index 232a68ad..93c5dfad 100644 --- a/.github/workflows/reusable-pre_commit.yml +++ b/.github/workflows/reusable-pre_commit.yml @@ -8,7 +8,7 @@ on: required: false type: string os: - description: 'Matrix of OS to run against (eg. ["ubuntu-latest", "macos-latest"])' + description: 'List of OS to run against (e.g. ["ubuntu-latest", "macos-latest"])' required: false type: string default: "['ubuntu-latest']" diff --git a/.github/workflows/reusable-python-build_poetry_package.yml b/.github/workflows/reusable-python-build_poetry_package.yml index 9fe8b003..e5d7921a 100644 --- a/.github/workflows/reusable-python-build_poetry_package.yml +++ b/.github/workflows/reusable-python-build_poetry_package.yml @@ -8,7 +8,7 @@ on: required: true type: string python-version: - description: 'Python version to use (eg: 3.10)' + description: 'Python version to use (e.g. 3.10)' required: true type: string lfs: @@ -20,13 +20,12 @@ on: description: 'Version tag of the package to build' required: true type: string - virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-dev-pypi"])' + description: 'List of repository names to publish on (e.g. ["public-dev-pypi"])' required: true type: string os: - description: 'OS to build against (eg. "ubuntu-latest")' + description: 'OS to build against (e.g. "ubuntu-latest")' required: true type: string timeout-minutes: diff --git a/.github/workflows/reusable-python-build_setuptools_package.yml b/.github/workflows/reusable-python-build_setuptools_package.yml index 1ca065de..394cdc7b 100644 --- a/.github/workflows/reusable-python-build_setuptools_package.yml +++ b/.github/workflows/reusable-python-build_setuptools_package.yml @@ -8,7 +8,7 @@ on: required: true type: string python-version: - description: 'Python version to use (eg: 3.10)' + description: 'Python version to use (e.g. 3.10)' required: true type: string lfs: @@ -20,13 +20,12 @@ on: description: 'Version tag of the package to build' required: true type: string - virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-dev-pypi"])' + description: 'List of repository names to publish on (e.g. ["public-dev-pypi"])' required: true type: string os: - description: 'OS to build against (eg. "ubuntu-latest")' + description: 'OS to build against (e.g. "ubuntu-latest")' required: true type: string timeout-minutes: diff --git a/.github/workflows/reusable-python-publish_pypi_package.yml b/.github/workflows/reusable-python-publish_pypi_package.yml index 9eb236e6..ec899b7a 100644 --- a/.github/workflows/reusable-python-publish_pypi_package.yml +++ b/.github/workflows/reusable-python-publish_pypi_package.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: package-manager: - description: 'Name of the package manager (eg. "poetry")' + description: 'Name of the package manager (e.g. "poetry")' required: true type: string default: 'poetry' @@ -13,7 +13,7 @@ on: required: true type: string python-version: - description: 'Python version to use (eg: 3.10)' + description: 'Python version to use (e.g. 3.10)' required: true type: string lfs: @@ -26,11 +26,11 @@ on: required: true type: string virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-pypi-dev"])' + description: 'List of virtual repository names to publish on (e.g. ["public-pypi-dev"])' required: true type: string os: - description: 'OS to build against (eg. "ubuntu-latest")' + description: 'OS to build against (e.g. "ubuntu-latest")' required: false type: string default: 'ubuntu-latest' diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index 7e569516..f7392c66 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -8,7 +8,7 @@ on: required: true type: string python-version: - description: 'Python version to use (eg: 3.10)' + description: 'Python version to use (e.g. 3.10)' required: true type: string lfs: @@ -29,7 +29,7 @@ on: required: true type: string os: - description: 'OS to build against (eg. "ubuntu-latest")' + description: 'OS to build against (e.g. "ubuntu-latest")' required: false type: string default: 'ubuntu-latest' diff --git a/.github/workflows/reusable-python-pytest.yml b/.github/workflows/reusable-python-pytest.yml index 176577d3..a267f3ac 100644 --- a/.github/workflows/reusable-python-pytest.yml +++ b/.github/workflows/reusable-python-pytest.yml @@ -4,17 +4,17 @@ on: workflow_call: inputs: package-manager: - description: 'Package manager to use (eg. "conda", "poetry")' + description: 'Package manager to use (e.g. "conda", "poetry")' required: true type: string default: 'poetry' python-versions: - description: 'Matrix of Python versions to test against (eg. ["3.10", "3.11", "3.12"])' + description: 'List of Python versions to test against (e.g. ["3.10", "3.11", "3.12"])' required: false type: string default: "['3.10']" os: - description: 'Matrix of OS to test against (eg. ["ubuntu-latest", "macos-latest"])' + description: 'List of OS to test against (e.g. ["ubuntu-latest", "macos-latest"])' required: false type: string default: "['ubuntu-latest']" @@ -28,16 +28,16 @@ on: required: false type: string codecov-reference-os: - description: 'Matrix of OS to use as reference for Codecov' + description: 'List of OS to use as reference for Codecov' required: false type: string default: "['windows-latest']" install-extras: - description: 'Extra dependencies to install (eg. ["torch", "cuda"])' + description: 'Extra dependencies to install (e.g. ["torch", "cuda"])' required: false type: string virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-dev-pypi"])' + description: 'List of repository names to publish on (e.g. ["public-dev-pypi"])' required: false type: string lfs: diff --git a/.github/workflows/reusable-python-release_conda_assets.yml b/.github/workflows/reusable-python-release_conda_assets.yml index 3e447d70..b1300fbb 100644 --- a/.github/workflows/reusable-python-release_conda_assets.yml +++ b/.github/workflows/reusable-python-release_conda_assets.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-conda-prod"])' + description: 'List of repository names to publish on (e.g. ["public-conda-prod"])' required: true type: string release-tag: diff --git a/.github/workflows/reusable-python-release_pypi_assets.yml b/.github/workflows/reusable-python-release_pypi_assets.yml index 9266170f..7d7b265d 100644 --- a/.github/workflows/reusable-python-release_pypi_assets.yml +++ b/.github/workflows/reusable-python-release_pypi_assets.yml @@ -8,7 +8,7 @@ on: required: true type: string virtual-repo-names: - description: 'Matrix of virtual repository names to publish on (eg. ["public-pypi-prod"])' + description: 'List of repository names to publish on (e.g. ["public-pypi-prod"])' required: true type: string release-tag: diff --git a/.github/workflows/reusable-python-static_analysis.yml b/.github/workflows/reusable-python-static_analysis.yml index 2553385f..807e3d31 100644 --- a/.github/workflows/reusable-python-static_analysis.yml +++ b/.github/workflows/reusable-python-static_analysis.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: package-manager: - description: 'Package manager to use (eg. "conda", "poetry")' + description: 'Package manager to use (e.g. "conda", "poetry")' required: true type: string default: 'poetry' @@ -18,11 +18,11 @@ on: type: string default: '3.10' install-extras: - description: 'Extra dependencies to install (eg. ["torch", "cuda"])' + description: 'Extra dependencies to install (e.g. ["torch", "cuda"])' required: false type: string virtual-repo-names: - description: 'Matrix of virtual repository names to resolve on (eg. ["public-dev-pypi"])' + description: 'List of repository names to resolve on (e.g. ["public-dev-pypi"])' required: false type: string timeout-minutes: @@ -31,7 +31,7 @@ on: type: number default: 20 os: - description: 'Matrix of OS to test against (eg. ["ubuntu-latest", "macos-latest"])' + description: 'List of OS to test against (e.g. ["ubuntu-latest", "macos-latest"])' required: false type: string default: "['ubuntu-latest']" From 0fd1832de7035567d9efa08b5280c63f08673172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 01:15:04 -0400 Subject: [PATCH 6/8] [DEVOPS-678] use strict channel priority flexible was not a valid choice. Must be either disabled or strict --- .../workflows/reusable-python-publish_rattler_package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index f7392c66..03214c26 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -96,9 +96,6 @@ jobs: BUILDS_ARGS+=" --channel ${channel_name}" done - BUILDS_ARGS+=" --output-dir ${{ runner.temp }}/output" - BUILDS_ARGS+=" --channel-priority flexible" - echo "RATTLER_AUTH_FILE=${RATTLER_AUTH_FILE}" >> "$GITHUB_ENV" echo "BUILDS_ARGS=$BUILDS_ARGS" >> "$GITHUB_ENV" - name: Check RATTLER_AUTH_FILE content @@ -113,7 +110,10 @@ jobs: uses: prefix-dev/rattler-build-action@v0.2.32 with: rattler-build-version: v0.34.1 - build-args: ${{ env.BUILDS_ARGS }} + build-args: >- + --output-dir ${{ runner.temp }}/output + --channel-priority strict + ${{ env.BUILDS_ARGS }} recipe-path: ${{ github.workspace}}/recipe.yaml env: RATTLER_AUTH_FILE: ${{ runner.temp }}/credentials.json From 2a525bdd9936eaa85169825e8fc457d9f204bc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 01:32:03 -0400 Subject: [PATCH 7/8] [DEVOPS-678] use step output rather than env var --- .../reusable-python-publish_rattler_package.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index 03214c26..238254f2 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -76,28 +76,29 @@ jobs: echo "Rattler recipe not found" exit 1 fi - - name: Auths with JFrog channels + - name: Configure channels and Auth + id: config-channels run: | - BUILDS_ARGS="" + BUILD_ARGS="" RATTLER_AUTH_FILE=${{ runner.temp }}/credentials.json repository_list=$(echo '${{ inputs.source-repo-names }}' | jq -r '.[]' | xargs) if [ -n "$repository_list" ]; then echo '{"${{ secrets.JFROG_ARTIFACTORY_URL }}": {"BasicHTTP": {"username": "github", "password":"${{ secrets.JFROG_ARTIFACTORY_TOKEN }}"} } }' > "$RATTLER_AUTH_FILE" fi + echo "RATTLER_AUTH_FILE=${RATTLER_AUTH_FILE}" >> "$GITHUB_ENV" # Loop through the repository names and add them to the command for repo_name in ${repository_list}; do - BUILDS_ARGS+=" --channel https://${{ secrets.JFROG_ARTIFACTORY_URL }}/artifactory/api/conda/${repo_name}" + BUILD_ARGS+=" --channel https://${{ secrets.JFROG_ARTIFACTORY_URL }}/artifactory/api/conda/${repo_name}" done channnel_list=$(echo '${{ inputs.conda-channels }}' | jq -r '.[]' | xargs) for channel_name in ${channel_list}; do - BUILDS_ARGS+=" --channel ${channel_name}" + BUILD_ARGS+=" --channel ${channel_name}" done - echo "RATTLER_AUTH_FILE=${RATTLER_AUTH_FILE}" >> "$GITHUB_ENV" - echo "BUILDS_ARGS=$BUILDS_ARGS" >> "$GITHUB_ENV" + echo "BUILD_ARGS=$BUILD_ARGS" >> "$GITHUB_OUTPUT" - name: Check RATTLER_AUTH_FILE content run: | echo "RATTLER_AUTH_FILE=${{ env.RATTLER_AUTH_FILE }}" @@ -113,7 +114,7 @@ jobs: build-args: >- --output-dir ${{ runner.temp }}/output --channel-priority strict - ${{ env.BUILDS_ARGS }} + ${{ steps.config-channels.outputs.BUILD_ARGS }} recipe-path: ${{ github.workspace}}/recipe.yaml env: RATTLER_AUTH_FILE: ${{ runner.temp }}/credentials.json From 228e7a72186a7db5c540a8c80a553702b13e9ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Hensgen?= Date: Wed, 19 Mar 2025 01:58:04 -0400 Subject: [PATCH 8/8] [DEVOPS-678] fix wrong variable name --- .github/workflows/reusable-python-publish_rattler_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-python-publish_rattler_package.yml b/.github/workflows/reusable-python-publish_rattler_package.yml index 238254f2..965aaf98 100644 --- a/.github/workflows/reusable-python-publish_rattler_package.yml +++ b/.github/workflows/reusable-python-publish_rattler_package.yml @@ -93,7 +93,7 @@ jobs: BUILD_ARGS+=" --channel https://${{ secrets.JFROG_ARTIFACTORY_URL }}/artifactory/api/conda/${repo_name}" done - channnel_list=$(echo '${{ inputs.conda-channels }}' | jq -r '.[]' | xargs) + channel_list=$(echo '${{ inputs.conda-channels }}' | jq -r '.[]' | xargs) for channel_name in ${channel_list}; do BUILD_ARGS+=" --channel ${channel_name}" done