Fix 'on: push' branch and only log into Conan remote when pushing #51
Workflow file for this run
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: Export | |
| on: | |
| pull_request: | |
| paths: | |
| - '.github/workflows/export.yml' | |
| - 'recipes/**' | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/export.yml' | |
| - 'recipes/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| export: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Conan | |
| uses: conan-io/setup-conan@v1 | |
| - name: Add Conan remote | |
| if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }} | |
| run: | | |
| conan remote add --index 0 ${{ vars.CONAN_REMOTE_NAME }} ${{ vars.CONAN_REMOTE_URL }} | |
| echo "Added new conan remote '${{ vars.CONAN_REMOTE_NAME }}' at ${{ vars.CONAN_REMOTE_URL }}." | |
| - name: Log into Conan remote | |
| if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }} | |
| run: | | |
| conan remote login ${{ vars.CONAN_REMOTE_NAME }} ${{ secrets.CONAN_REMOTE_USERNAME }} --password "${{ secrets.CONAN_REMOTE_PASSWORD }}" | |
| conan remote list-users | |
| - name: Export the recipes | |
| working-directory: recipes | |
| run: | | |
| conan export grpc/all --version=1.72.0 | |
| conan export m4/all --version=1.4.19 | |
| conan export snappy/all --version=1.1.10 | |
| conan export soci/all --version=4.0.3 | |
| conan export wasm-xrplf/all --version=2.4.1-xrplf | |
| - name: Upload the recipes (dry run) | |
| run: conan upload '*' --confirm --check --only-recipe --remote ${{ vars.CONAN_REMOTE_NAME }} --dry-run | |
| - name: Upload the recipes | |
| if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }} | |
| run: conan upload '*' --confirm --check --only-recipe --remote ${{ vars.CONAN_REMOTE_NAME }} |