mirror of
				https://github.com/XRPLF/rippled.git
				synced 2025-11-04 11:15:56 +00:00 
			
		
		
		
	chore: Set free-form CI inputs as env vars (#5822)
This change moves CI values that could be user-provided into environment variables.
This commit is contained in:
		
							
								
								
									
										16
									
								
								.github/actions/build-deps/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								.github/actions/build-deps/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -20,14 +20,18 @@ runs:
 | 
			
		||||
  steps:
 | 
			
		||||
    - name: Install Conan dependencies
 | 
			
		||||
      shell: bash
 | 
			
		||||
      env:
 | 
			
		||||
        BUILD_DIR: ${{ inputs.build_dir }}
 | 
			
		||||
        BUILD_OPTION: ${{ inputs.force_build == 'true' && '*' || 'missing' }}
 | 
			
		||||
        BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
      run: |
 | 
			
		||||
        echo 'Installing dependencies.'
 | 
			
		||||
        mkdir -p ${{ inputs.build_dir }}
 | 
			
		||||
        cd ${{ inputs.build_dir }}
 | 
			
		||||
        mkdir -p '${{ env.BUILD_DIR }}'
 | 
			
		||||
        cd '${{ env.BUILD_DIR }}'
 | 
			
		||||
        conan install \
 | 
			
		||||
          --output-folder . \
 | 
			
		||||
          --build ${{ inputs.force_build == 'true' && '"*"' || 'missing' }} \
 | 
			
		||||
          --options:host '&:tests=True' \
 | 
			
		||||
          --options:host '&:xrpld=True' \
 | 
			
		||||
          --settings:all build_type=${{ inputs.build_type }} \
 | 
			
		||||
          --build=${{ env.BUILD_OPTION }} \
 | 
			
		||||
          --options:host='&:tests=True' \
 | 
			
		||||
          --options:host='&:xrpld=True' \
 | 
			
		||||
          --settings:all build_type='${{ env.BUILD_TYPE }}' \
 | 
			
		||||
          ..
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/actions/setup-conan/action.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/actions/setup-conan/action.yml
									
									
									
									
										vendored
									
									
								
							@@ -35,9 +35,12 @@ runs:
 | 
			
		||||
 | 
			
		||||
    - name: Set up Conan remote
 | 
			
		||||
      shell: bash
 | 
			
		||||
      env:
 | 
			
		||||
        CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
 | 
			
		||||
        CONAN_REMOTE_URL: ${{ inputs.conan_remote_url }}
 | 
			
		||||
      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 "Adding Conan remote '${{ env.CONAN_REMOTE_NAME }}' at '${{ env.CONAN_REMOTE_URL }}'."
 | 
			
		||||
        conan remote add --index 0 --force '${{ env.CONAN_REMOTE_NAME }}' '${{ env.CONAN_REMOTE_URL }}'
 | 
			
		||||
 | 
			
		||||
        echo 'Listing Conan remotes.'
 | 
			
		||||
        conan remote list
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								.github/workflows/reusable-build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/reusable-build.yml
									
									
									
									
										vendored
									
									
								
							@@ -76,23 +76,29 @@ jobs:
 | 
			
		||||
      - name: Configure CMake
 | 
			
		||||
        shell: bash
 | 
			
		||||
        working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
          CMAKE_ARGS: ${{ inputs.cmake_args }}
 | 
			
		||||
        run: |
 | 
			
		||||
          cmake \
 | 
			
		||||
            -G '${{ runner.os == 'Windows' && 'Visual Studio 17 2022' || 'Ninja' }}' \
 | 
			
		||||
            -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \
 | 
			
		||||
            -DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
 | 
			
		||||
            ${{ inputs.cmake_args }} \
 | 
			
		||||
            -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
 | 
			
		||||
            ${{ env.CMAKE_ARGS }} \
 | 
			
		||||
            ..
 | 
			
		||||
 | 
			
		||||
      - name: Build the binary
 | 
			
		||||
        shell: bash
 | 
			
		||||
        working-directory: ${{ inputs.build_dir }}
 | 
			
		||||
        env:
 | 
			
		||||
          BUILD_TYPE: ${{ inputs.build_type }}
 | 
			
		||||
          CMAKE_TARGET: ${{ inputs.cmake_target }}
 | 
			
		||||
        run: |
 | 
			
		||||
          cmake \
 | 
			
		||||
            --build . \
 | 
			
		||||
            --config ${{ inputs.build_type }} \
 | 
			
		||||
            --config ${{ env.BUILD_TYPE }} \
 | 
			
		||||
            --parallel $(nproc) \
 | 
			
		||||
            --target ${{ inputs.cmake_target }}
 | 
			
		||||
            --target ${{ env.CMAKE_TARGET }}
 | 
			
		||||
 | 
			
		||||
      - name: Upload rippled artifact
 | 
			
		||||
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								.github/workflows/reusable-notify-clio.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								.github/workflows/reusable-notify-clio.yml
									
									
									
									
										vendored
									
									
								
							@@ -46,41 +46,44 @@ jobs:
 | 
			
		||||
        uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
 | 
			
		||||
      - name: Generate outputs
 | 
			
		||||
        id: generate
 | 
			
		||||
        env:
 | 
			
		||||
          PR_NUMBER: ${{ github.event.pull_request.number }}
 | 
			
		||||
        run: |
 | 
			
		||||
          echo 'Generating user and channel.'
 | 
			
		||||
          echo "user=clio" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo "channel=pr_${{ github.event.pull_request.number }}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo "channel=pr_${{ env.PR_NUMBER }}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
          echo 'Extracting version.'
 | 
			
		||||
          echo "version=$(cat src/libxrpl/protocol/BuildInfo.cpp | grep "versionString =" | awk -F '"' '{print $2}')" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
      - name: Calculate conan reference
 | 
			
		||||
        id: conan_ref
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "conan_ref=${{ steps.generate.outputs.version }}@${{ steps.generate.outputs.user }}/${{ steps.generate.outputs.channel }}" >> "${GITHUB_OUTPUT}"
 | 
			
		||||
 | 
			
		||||
      - name: Set up Conan
 | 
			
		||||
        uses: ./.github/actions/setup-conan
 | 
			
		||||
        with:
 | 
			
		||||
          conan_remote_name: ${{ inputs.conan_remote_name }}
 | 
			
		||||
          conan_remote_url: ${{ inputs.conan_remote_url }}
 | 
			
		||||
 | 
			
		||||
      - 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
 | 
			
		||||
        env:
 | 
			
		||||
          CONAN_REMOTE_NAME: ${{ inputs.conan_remote_name }}
 | 
			
		||||
        run: |
 | 
			
		||||
          conan export --user=${{ steps.generate.outputs.user }} --channel=${{ steps.generate.outputs.channel }} .
 | 
			
		||||
          conan upload --confirm --check --remote=${{ inputs.conan_remote_name }} xrpl/${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
          conan upload --confirm --check --remote=${{ env.CONAN_REMOTE_NAME }} xrpl/${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
    outputs:
 | 
			
		||||
      conan_ref: ${{ steps.conan_ref.outputs.conan_ref }}
 | 
			
		||||
 | 
			
		||||
  notify:
 | 
			
		||||
    needs: upload
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    env:
 | 
			
		||||
      GH_TOKEN: ${{ secrets.clio_notify_token }}
 | 
			
		||||
    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]=${{ github.event.pull_request.html_url }}"
 | 
			
		||||
          -F "client_payload[pr_url]=${{ env.PR_URL }}"
 | 
			
		||||
 
 | 
			
		||||
@@ -35,4 +35,7 @@ jobs:
 | 
			
		||||
      - name: Generate strategy matrix
 | 
			
		||||
        working-directory: .github/scripts/strategy-matrix
 | 
			
		||||
        id: generate
 | 
			
		||||
        run: ./generate.py ${{ inputs.strategy_matrix == 'all' && '--all' || '' }} ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }} >> "${GITHUB_OUTPUT}"
 | 
			
		||||
        env:
 | 
			
		||||
          GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
 | 
			
		||||
          GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
 | 
			
		||||
        run: ./generate.py ${{ env.GENERATE_OPTION }} ${{ env.GENERATE_CONFIG }} >> "${GITHUB_OUTPUT}"
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								.github/workflows/upload-conan-deps.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/upload-conan-deps.yml
									
									
									
									
										vendored
									
									
								
							@@ -24,13 +24,10 @@ on:
 | 
			
		||||
    branches: [develop]
 | 
			
		||||
    paths:
 | 
			
		||||
      - .github/workflows/upload-conan-deps.yml
 | 
			
		||||
 | 
			
		||||
      - .github/workflows/reusable-strategy-matrix.yml
 | 
			
		||||
 | 
			
		||||
      - .github/actions/build-deps/action.yml
 | 
			
		||||
      - .github/actions/setup-conan/action.yml
 | 
			
		||||
      - ".github/scripts/strategy-matrix/**"
 | 
			
		||||
 | 
			
		||||
      - conanfile.py
 | 
			
		||||
      - conan.lock
 | 
			
		||||
 | 
			
		||||
@@ -88,4 +85,6 @@ jobs:
 | 
			
		||||
 | 
			
		||||
      - name: Upload Conan packages
 | 
			
		||||
        if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' && github.event_name != 'schedule' }}
 | 
			
		||||
        run: conan upload "*" -r=${{ env.CONAN_REMOTE_NAME }} --confirm ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
 | 
			
		||||
        env:
 | 
			
		||||
          FORCE_OPTION: ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }}
 | 
			
		||||
        run: conan upload "*" --remote='${{ env.CONAN_REMOTE_NAME }}' --confirm ${{ env.FORCE_OPTION }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user