mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-04 11:15:56 +00:00
81 lines
3.3 KiB
YAML
81 lines
3.3 KiB
YAML
# This workflow exports the built libxrpl package to the Conan remote on a
|
|
# a channel named after the pull request, and notifies the Clio repository about
|
|
# the new version so it can check for compatibility.
|
|
name: Notify Clio
|
|
|
|
# This workflow can only be triggered by other workflows.
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
conan_remote_name:
|
|
description: "The name of the Conan remote to use."
|
|
required: true
|
|
type: string
|
|
conan_remote_url:
|
|
description: "The URL of the Conan endpoint to use."
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
clio_notify_token:
|
|
description: "The GitHub token to notify Clio about new versions."
|
|
required: true
|
|
conan_remote_username:
|
|
description: "The username for logging into the Conan remote."
|
|
required: true
|
|
conan_remote_password:
|
|
description: "The password for logging into the Conan remote."
|
|
required: true
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-clio
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
upload:
|
|
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
|
runs-on: ubuntu-latest
|
|
container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
- name: Generate outputs
|
|
id: generate
|
|
run: |
|
|
echo 'Generating user and channel.'
|
|
echo "user=clio" >> "${GITHUB_OUTPUT}"
|
|
echo "channel=pr_${{ github.event.pull_request.number }}" >> "${GITHUB_OUTPUT}"
|
|
echo 'Extracting version.'
|
|
echo "version=$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" | awk -F '"' '{print $2}')" >> "${GITHUB_OUTPUT}"
|
|
- name: Add Conan remote
|
|
run: |
|
|
echo "Adding Conan remote '${{ inputs.conan_remote_name }}' at ${{ inputs.conan_remote_url }}."
|
|
conan remote add --index 0 --force ${{ inputs.conan_remote_name }} ${{ inputs.conan_remote_url }}
|
|
echo 'Listing Conan remotes.'
|
|
conan remote list
|
|
- name: Log into Conan remote
|
|
run: conan remote login ${{ inputs.conan_remote_name }} "${{ secrets.conan_remote_username }}" --password "${{ secrets.conan_remote_password }}"
|
|
- name: Upload package
|
|
run: |
|
|
conan export --user=${{ steps.generate.outputs.user }} --channel=${{ steps.generate.outputs.channel }} .
|
|
conan upload --confirm --check --remote=${{ inputs.conan_remote_name }} xrpl/${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}
|
|
outputs:
|
|
channel: ${{ steps.generate.outputs.channel }}
|
|
version: ${{ steps.generate.outputs.version }}
|
|
|
|
notify:
|
|
needs: upload
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GH_TOKEN: ${{ secrets.clio_notify_token }}
|
|
steps:
|
|
- name: Notify Clio
|
|
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[version]=${{ needs.upload.outputs.version }}@${{ needs.upload.outputs.user }}/${{ needs.upload.outputs.channel }}" \
|
|
-F "client_payload[pr]=${{ github.event.pull_request.number }}"
|