Upload Conan Dependencies #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upload Conan Dependencies | |
| on: | |
| schedule: | |
| - cron: "0 3 * * 2-6" | |
| workflow_dispatch: | |
| inputs: | |
| force_source_build: | |
| description: "Force source build of all dependencies" | |
| required: false | |
| default: false | |
| type: boolean | |
| force_upload: | |
| description: "Force upload of all dependencies" | |
| required: false | |
| default: false | |
| type: boolean | |
| pull_request: | |
| branches: [develop] | |
| paths: | |
| # This allows testing changes to the upload workflow in a PR | |
| - .github/workflows/upload-conan-deps.yml | |
| push: | |
| 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 | |
| env: | |
| CONAN_REMOTE_NAME: xrplf | |
| CONAN_REMOTE_URL: https://conan.ripplex.io | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| generate-matrix: | |
| uses: ./.github/workflows/reusable-strategy-matrix.yml | |
| with: | |
| strategy_matrix: ${{ github.event_name == 'pull_request' && 'minimal' || 'all' }} | |
| run-upload-conan-deps: | |
| needs: | |
| - generate-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
| max-parallel: 10 | |
| runs-on: ${{ matrix.architecture.runner }} | |
| container: ${{ contains(matrix.architecture.platform, 'linux') && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }} | |
| steps: | |
| - name: Cleanup workspace | |
| if: ${{ runner.os == 'macOS' }} | |
| uses: XRPLF/actions/.github/actions/cleanup-workspace@3f044c7478548e3c32ff68980eeb36ece02b364e | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
| - name: Prepare runner | |
| uses: XRPLF/actions/.github/actions/prepare-runner@638e0dc11ea230f91bd26622fb542116bb5254d5 | |
| with: | |
| disable_ccache: false | |
| - name: Setup Conan | |
| uses: ./.github/actions/setup-conan | |
| with: | |
| conan_remote_name: ${{ env.CONAN_REMOTE_NAME }} | |
| conan_remote_url: ${{ env.CONAN_REMOTE_URL }} | |
| - name: Build dependencies | |
| uses: ./.github/actions/build-deps | |
| with: | |
| build_dir: .build | |
| build_type: ${{ matrix.build_type }} | |
| force_build: ${{ github.event_name == 'schedule' || github.event.inputs.force_source_build == 'true' }} | |
| - name: Log into Conan remote | |
| if: ${{ github.repository_owner == 'XRPLF' && github.event_name != 'pull_request' }} | |
| run: conan remote login ${{ env.CONAN_REMOTE_NAME }} "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}" | |
| - 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' || '' }} |