diff --git a/.github/actions/generate-version/action.yml b/.github/actions/generate-version/action.yml index 687ee638c5..874bb303ae 100644 --- a/.github/actions/generate-version/action.yml +++ b/.github/actions/generate-version/action.yml @@ -13,8 +13,8 @@ runs: id: version shell: bash env: - # Only append the commit hash for the develop branch. For releases the - # version is used as-is. We will shorten it to 6 characters below. + # Append a shortened commit hash for the develop branch. For releases + # the version is used as-is. COMMIT_HASH: ${{ github.ref == 'refs/heads/develop' && github.sha || '' }} run: | echo 'Extracting version from BuildInfo.cpp.' @@ -26,7 +26,7 @@ runs: if [[ -n "${COMMIT_HASH}" ]]; then echo 'Appending shortened commit hash to version.' - VERSION="${VERSION}-${COMMIT_HASH:0:6}" + VERSION="${VERSION}-${COMMIT_HASH:0:7}" fi echo "version=${VERSION}" >> "${GITHUB_OUTPUT}" diff --git a/.github/actions/setup-conan/action.yml b/.github/actions/setup-conan/action.yml index dedf53f109..37956c5f21 100644 --- a/.github/actions/setup-conan/action.yml +++ b/.github/actions/setup-conan/action.yml @@ -2,11 +2,11 @@ name: Setup Conan description: "Set up Conan configuration, profile, and remote." inputs: - conan_remote_name: + remote_name: description: "The name of the Conan remote to use." required: false default: xrplf - conan_remote_url: + remote_url: description: "The URL of the Conan endpoint to use." required: false default: https://conan.ripplex.io @@ -36,11 +36,11 @@ runs: - name: Set up Conan remote shell: bash env: - CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }} - CONAN_REMOTE_URL: ${{ inputs.conan_remote_url }} + REMOTE_NAME: ${{ inputs.remote_name }} + REMOTE_URL: ${{ inputs.remote_url }} run: | - echo "Adding Conan remote '${CONAN_REMOTE_NAME}' at '${CONAN_REMOTE_URL}'." - conan remote add --index 0 --force "${CONAN_REMOTE_NAME}" "${CONAN_REMOTE_URL}" + echo "Adding Conan remote '${REMOTE_NAME}' at '${REMOTE_URL}'." + conan remote add --index 0 --force "${REMOTE_NAME}" "${REMOTE_URL}" echo 'Listing Conan remotes.' conan remote list diff --git a/.github/actions/upload-recipe/action.yml b/.github/actions/upload-recipe/action.yml index bab734ea4f..92b588ce55 100644 --- a/.github/actions/upload-recipe/action.yml +++ b/.github/actions/upload-recipe/action.yml @@ -2,19 +2,19 @@ name: Upload Conan recipe description: "Upload recipe to a Conan remote." inputs: - conan_recipe_ref: + recipe_ref: description: "The Conan recipe reference ('name/version') to upload." required: true - conan_remote_name: + remote_name: description: "The name of the Conan remote to use." required: true - conan_remote_url: + remote_url: description: "The URL of the Conan endpoint to use." required: true - conan_remote_username: + remote_username: description: "The username for logging into the Conan remote." required: true - conan_remote_password: + remote_password: description: "The password for logging into the Conan remote." required: true @@ -25,22 +25,22 @@ runs: - name: Set up Conan uses: ./.github/actions/setup-conan with: - conan_remote_name: ${{ inputs.conan_remote_name }} - conan_remote_url: ${{ inputs.conan_remote_url }} + remote_name: ${{ inputs.remote_name }} + remote_url: ${{ inputs.remote_url }} - name: Log into Conan remote shell: bash env: - CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }} - CONAN_REMOTE_USERNAME: ${{ inputs.conan_remote_username }} - CONAN_REMOTE_PASSWORD: ${{ inputs.conan_remote_password }} - run: conan remote login "${CONAN_REMOTE_NAME}" "${CONAN_REMOTE_USERNAME}" --password "${CONAN_REMOTE_PASSWORD}" + REMOTE_NAME: ${{ inputs.remote_name }} + REMOTE_USERNAME: ${{ inputs.remote_username }} + REMOTE_PASSWORD: ${{ inputs.remote_password }} + run: conan remote login "${REMOTE_NAME}" "${REMOTE_USERNAME}" --password "${REMOTE_PASSWORD}" - name: Upload Conan recipe shell: bash env: - CONAN_RECIPE_REF: ${{ inputs.conan_recipe_ref }} - CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }} + RECIPE_REF: ${{ inputs.recipe_ref }} + REMOTE_NAME: ${{ inputs.remote_name }} run: | conan export . - conan upload --confirm --check --remote="${CONAN_REMOTE_NAME}" ${CONAN_RECIPE_REF} + conan upload --confirm --check --remote="${REMOTE_NAME}" ${RECIPE_REF} diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index 8ffb37b6d8..cf8f558a70 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -131,16 +131,33 @@ jobs: if: ${{ github.repository_owner == 'XRPLF' && needs.should-run.outputs.go == 'true' && startsWith(github.ref, 'refs/heads/release') }} uses: ./.github/workflows/reusable-upload-recipe.yml secrets: - clio_notify_token: ${{ secrets.CLIO_NOTIFY_TOKEN }} - conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} - conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }} + remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} + remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }} + + notify-clio: + needs: upload-recipe + runs-on: ubuntu-latest + steps: + # Notify the Clio repository about the newly proposed release version, so + # it can be checked for compatibility before the release is actually made. + - name: Notify Clio + env: + GH_TOKEN: ${{ secrets.clio_notify_token }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: | + gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \ + -F "client_payload[ref]=${{ needs.upload-recipe.outputs.recipe_ref }}" \ + -F "client_payload[pr_url]=${PR_URL}" passed: if: failure() || cancelled() needs: - - build-test - check-levelization + - check-rename + - build-test - upload-recipe + - notify-clio runs-on: ubuntu-latest steps: - name: Fail diff --git a/.github/workflows/on-trigger.yml b/.github/workflows/on-trigger.yml index c8afb893b8..270f50cb86 100644 --- a/.github/workflows/on-trigger.yml +++ b/.github/workflows/on-trigger.yml @@ -86,5 +86,5 @@ jobs: if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' && github.ref == 'refs/heads/develop' }} uses: ./.github/workflows/reusable-upload-recipe.yml secrets: - conan_remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} - conan_remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }} + remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} + remote_password: ${{ secrets.CONAN_REMOTE_PASSWORD }} diff --git a/.github/workflows/reusable-upload-recipe.yml b/.github/workflows/reusable-upload-recipe.yml index a8984eaa43..bd68f452b9 100644 --- a/.github/workflows/reusable-upload-recipe.yml +++ b/.github/workflows/reusable-upload-recipe.yml @@ -1,33 +1,34 @@ -# This workflow exports the built libxrpl package to the Conan remote, and for -# releases also notifies the Clio repository about the new version, so it can -# check for compatibility. +# This workflow exports the built libxrpl package to the Conan remote. name: Upload Conan recipe # This workflow can only be triggered by other workflows. on: workflow_call: inputs: - conan_remote_name: + remote_name: description: "The name of the Conan remote to use." required: false type: string default: xrplf - conan_remote_url: + remote_url: description: "The URL of the Conan endpoint to use." required: false type: string default: https://conan.ripplex.io + secrets: - clio_notify_token: - description: "The GitHub token to notify Clio about new versions." - required: false - conan_remote_username: + remote_username: description: "The username for logging into the Conan remote." required: true - conan_remote_password: + remote_password: description: "The password for logging into the Conan remote." required: true + outputs: + recipe_ref: + description: "The Conan recipe reference ('name/version') that was uploaded." + value: ${{ jobs.upload.outputs.ref }} + concurrency: group: ${{ github.workflow }}-${{ github.ref }}-upload-recipe cancel-in-progress: true @@ -56,25 +57,10 @@ jobs: uses: ./.github/actions/upload-recipe id: upload with: - conan_recipe_ref: ${{ steps.version.outputs.version }} - conan_remote_name: ${{ inputs.conan_remote_name }} - conan_remote_url: ${{ inputs.conan_remote_url }} - conan_remote_username: ${{ secrets.conan_remote_username }} - conan_remote_password: ${{ secrets.conan_remote_password }} + recipe_ref: ${{ steps.ref.outputs.ref }} + remote_name: ${{ inputs.remote_name }} + remote_url: ${{ inputs.remote_url }} + remote_username: ${{ secrets.remote_username }} + remote_password: ${{ secrets.remote_password }} outputs: - conan_ref: ${{ steps.ref.outputs.ref }} - - notify: - needs: upload - if: ${{ github.event_name == 'pull_request' }} - runs-on: ubuntu-latest - steps: - - name: Notify Clio - env: - GH_TOKEN: ${{ secrets.clio_notify_token }} - PR_URL: ${{ github.event.pull_request.html_url }} - run: | - gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" \ - /repos/xrplf/clio/dispatches -f "event_type=check_libxrpl" \ - -F "client_payload[conan_ref]=${{ needs.upload.outputs.conan_ref }}" \ - -F "client_payload[pr_url]=${PR_URL}" + ref: ${{ steps.ref.outputs.ref }} diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index 29ae95fce5..711354d490 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -86,8 +86,8 @@ jobs: - name: Setup Conan uses: ./.github/actions/setup-conan with: - conan_remote_name: ${{ env.CONAN_REMOTE_NAME }} - conan_remote_url: ${{ env.CONAN_REMOTE_URL }} + remote_name: ${{ env.CONAN_REMOTE_NAME }} + remote_url: ${{ env.CONAN_REMOTE_URL }} - name: Build dependencies uses: ./.github/actions/build-deps