Skip to content

Commit 127143d

Browse files
authored
Fix 'on: push' branch and only log into Conan remote when pushing (#22)
1 parent 177514d commit 127143d

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

.github/workflows/export.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- 'recipes/**'
88
push:
99
branches:
10-
- main
10+
- master
1111
paths:
1212
- '.github/workflows/export.yml'
1313
- 'recipes/**'
@@ -20,23 +20,18 @@ defaults:
2020
run:
2121
shell: bash
2222

23+
env:
24+
CONAN_REMOTE_NAME: xrplf
25+
CONAN_REMOTE_URL: https://conan.ripplex.io
26+
2327
jobs:
2428
export:
2529
runs-on: ubuntu-latest
2630
steps:
2731
- name: Checkout repository
28-
uses: actions/checkout@v4
32+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2933
- name: Install Conan
30-
uses: conan-io/setup-conan@v1
31-
- name: Add Conan remote
32-
run: |
33-
conan remote add --index 0 ${{ vars.CONAN_REMOTE_NAME }} ${{ vars.CONAN_REMOTE_URL }}
34-
echo "Added new conan remote '${{ vars.CONAN_REMOTE_NAME }}' at ${{ vars.CONAN_REMOTE_URL }}."
35-
- name: Log into Conan remote
36-
if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }}
37-
run: |
38-
conan remote login ${{ vars.CONAN_REMOTE_NAME }} ${{ secrets.CONAN_REMOTE_USERNAME }} --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
39-
conan remote list-users
34+
uses: conan-io/setup-conan@09566912d661de90608308897a4d513e850c04e8 # v1.2.0
4035
- name: Export the recipes
4136
working-directory: recipes
4237
run: |
@@ -45,8 +40,17 @@ jobs:
4540
conan export snappy/all --version=1.1.10
4641
conan export soci/all --version=4.0.3
4742
conan export wasm-xrplf/all --version=2.4.1-xrplf
43+
- name: Add Conan remote
44+
run: |
45+
conan remote add --index 0 ${{ env.CONAN_REMOTE_NAME }} ${{ env.CONAN_REMOTE_URL }}
46+
echo "Added new conan remote '${{ env.CONAN_REMOTE_NAME }}' at ${{ env.CONAN_REMOTE_URL }}."
4847
- name: Upload the recipes (dry run)
49-
run: conan upload '*' --confirm --check --only-recipe --remote ${{ vars.CONAN_REMOTE_NAME }} --dry-run
48+
run: conan upload '*' --confirm --check --only-recipe --remote ${{ env.CONAN_REMOTE_NAME }} --dry-run
49+
- name: Log into Conan remote
50+
if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }}
51+
run: |
52+
conan remote login ${{ env.CONAN_REMOTE_NAME }} ${{ secrets.CONAN_REMOTE_USERNAME }} --password "${{ secrets.CONAN_REMOTE_PASSWORD }}"
53+
conan remote list-users
5054
- name: Upload the recipes
5155
if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' }}
52-
run: conan upload '*' --confirm --check --only-recipe --remote ${{ vars.CONAN_REMOTE_NAME }}
56+
run: conan upload '*' --confirm --check --only-recipe --remote ${{ env.CONAN_REMOTE_NAME }}

0 commit comments

Comments
 (0)