Skip to content

Commit 39b5031

Browse files
authored
Switch Conan 1 commands to Conan 2 and fix credentials (#5655)
This change updates some incorrect Conan commands for Conan 2. As some flags do not exist in Conan 2, such as --settings build_type=[configuration], the commands have been adjusted accordingly. This change further uses the org-level variables and secrets rather than the repo-level ones.
1 parent 94decc7 commit 39b5031

File tree

5 files changed

+39
-42
lines changed

5 files changed

+39
-42
lines changed

.github/actions/dependencies/action.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,25 @@ name: dependencies
22
inputs:
33
configuration:
44
required: true
5-
# An implicit input is the environment variable `build_dir`.
5+
# Implicit inputs are the environment variables `build_dir`, CONAN_REMOTE_URL,
6+
# CONAN_REMOTE_USERNAME, and CONAN_REMOTE_PASSWORD. The latter two are only
7+
# used to upload newly built dependencies to the Conan remote.
68
runs:
79
using: composite
810
steps:
911
- name: add Conan remote
10-
if: env.CONAN_URL != ''
12+
if: ${{ env.CONAN_REMOTE_URL != '' }}
1113
shell: bash
1214
run: |
13-
if conan remote list | grep -q 'xrplf'; then
14-
conan remote update --index 0 --url ${CONAN_URL} xrplf
15-
echo "Updated Conan remote 'xrplf' to ${CONAN_URL}."
16-
else
17-
conan remote add --index 0 xrplf ${CONAN_URL}
18-
echo "Added new Conan remote 'xrplf' at ${CONAN_URL}."
19-
fi
20-
- name: list missing binaries
21-
id: binaries
22-
shell: bash
23-
# Print the list of dependencies that would need to be built locally.
24-
# A non-empty list means we have "failed" to cache binaries remotely.
25-
run: |
26-
echo missing=$(conan info . --build missing --settings build_type=${{ inputs.configuration }} --json 2>/dev/null | grep '^\[') | tee ${GITHUB_OUTPUT}
15+
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
16+
conan remote add --index 0 --force xrplf ${{ env.CONAN_REMOTE_URL }}
17+
echo "Listing Conan remotes."
18+
conan remote list
2719
- name: install dependencies
2820
shell: bash
2921
run: |
30-
mkdir ${build_dir}
31-
cd ${build_dir}
22+
mkdir -p ${{ env.build_dir }}
23+
cd ${{ env.build_dir }}
3224
conan install \
3325
--output-folder . \
3426
--build missing \
@@ -37,10 +29,10 @@ runs:
3729
--settings:all build_type=${{ inputs.configuration }} \
3830
..
3931
- name: upload dependencies
40-
if: ${{ env.CONAN_URL != '' && env.CONAN_LOGIN_USERNAME_XRPLF != '' && env.CONAN_PASSWORD_XRPLF != '' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
32+
if: ${{ env.CONAN_REMOTE_URL != '' && env.CONAN_REMOTE_USERNAME != '' && env.CONAN_REMOTE_PASSWORD != '' && github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }}
4133
shell: bash
4234
run: |
43-
echo "Logging into Conan remote 'xrplf' at ${CONAN_URL}."
44-
conan remote login xrplf "${{ env.CONAN_LOGIN_USERNAME_XRPLF }}" --password "${{ env.CONAN_PASSWORD_XRPLF }}"
45-
echo "Uploading dependencies for configuration '${{ inputs.configuration }}'."
46-
conan upload --all --confirm --remote xrplf . --settings build_type=${{ inputs.configuration }}
35+
echo "Logging into Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
36+
conan remote login xrplf "${{ env.CONAN_REMOTE_USERNAME }}" --password "${{ env.CONAN_REMOTE_PASSWORD }}"
37+
echo "Uploading dependencies."
38+
conan upload '*' --confirm --check --remote xrplf

.github/workflows/libxrpl.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Check libXRPL compatibility with Clio
22
env:
3-
CONAN_URL: https://conan.ripplex.io
4-
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
5-
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
3+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
4+
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_REMOTE_USERNAME }}
5+
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_REMOTE_PASSWORD }}
66
on:
77
pull_request:
88
paths:
@@ -46,10 +46,10 @@ jobs:
4646
- name: Add Conan remote
4747
shell: bash
4848
run: |
49+
echo "Adding Conan remote 'xrplf' at ${{ env.CONAN_REMOTE_URL }}."
50+
conan remote add xrplf ${{ env.CONAN_REMOTE_URL }} --insert 0 --force
51+
echo "Listing Conan remotes."
4952
conan remote list
50-
conan remote remove xrplf || true
51-
# Do not quote the URL. An empty string will be accepted (with a non-fatal warning), but a missing argument will not.
52-
conan remote add xrplf ${{ env.CONAN_URL }} --insert 0
5353
- name: Parse new version
5454
id: version
5555
shell: bash

.github/workflows/macos.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ concurrency:
1818
# This part of Conan configuration is specific to this workflow only; we do not want
1919
# to pollute conan/profiles directory with settings which might not work for others
2020
env:
21-
CONAN_URL: https://conan.ripplex.io
22-
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
23-
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
21+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
22+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
23+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
24+
# This part of the Conan configuration is specific to this workflow only; we
25+
# do not want to pollute the 'conan/profiles' directory with settings that
26+
# might not work for other workflows.
2427
CONAN_GLOBAL_CONF: |
2528
core.download:parallel={{os.cpu_count()}}
2629
core.upload:parallel={{os.cpu_count()}}

.github/workflows/nix.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

19-
# This part of Conan configuration is specific to this workflow only; we do not want
20-
# to pollute conan/profiles directory with settings which might not work for others
2119
env:
22-
CONAN_URL: https://conan.ripplex.io
23-
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
24-
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
20+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
21+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
22+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
23+
# This part of the Conan configuration is specific to this workflow only; we
24+
# do not want to pollute the 'conan/profiles' directory with settings that
25+
# might not work for other workflows.
2526
CONAN_GLOBAL_CONF: |
2627
core.download:parallel={{ os.cpu_count() }}
2728
core.upload:parallel={{ os.cpu_count() }}

.github/workflows/windows.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ on:
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.ref }}
2020
cancel-in-progress: true
21-
# This part of Conan configuration is specific to this workflow only; we do not want
22-
# to pollute conan/profiles directory with settings which might not work for others
2321
env:
24-
CONAN_URL: https://conan.ripplex.io
25-
CONAN_LOGIN_USERNAME_XRPLF: ${{ secrets.CONAN_USERNAME }}
26-
CONAN_PASSWORD_XRPLF: ${{ secrets.CONAN_TOKEN }}
22+
CONAN_REMOTE_URL: ${{ vars.CONAN_REMOTE_URL }}
23+
CONAN_REMOTE_USERNAME: ${{ secrets.CONAN_REMOTE_USERNAME }}
24+
CONAN_REMOTE_PASSWORD: ${{ secrets.CONAN_REMOTE_PASSWORD }}
25+
# This part of the Conan configuration is specific to this workflow only; we
26+
# do not want to pollute the 'conan/profiles' directory with settings that
27+
# might not work for other workflows.
2728
CONAN_GLOBAL_CONF: |
2829
core.download:parallel={{os.cpu_count()}}
2930
core.upload:parallel={{os.cpu_count()}}

0 commit comments

Comments
 (0)