@@ -31,42 +31,47 @@ jobs:
3131 runs-on : ubuntu-latest
3232 needs :
3333 - check
34- if : ${{ github.repository_owner == 'graphql-hive' && needs.check.outputs.crates_to_publish != '{}' }}
3534 env :
36- CRATES_TO_PUBLISH : ${{ fromJson(needs.check.outputs.crates_to_publish) }}
35+ CRATES_PUBLISH_JSON : ${{ needs.check.outputs.crates_to_publish }}
36+ PUBLISH_CONFIG_CRATE : ${{ contains(needs.check.outputs.crates_to_publish, '"hive-router-config"') }}
37+ PUBLISH_QUERY_PLANNER_CRATE : ${{ contains(needs.check.outputs.crates_to_publish, '"hive-router-query-planner"') }}
38+ PUBLISH_EXECUTOR_CRATE : ${{ contains(needs.check.outputs.crates_to_publish, '"hive-router-executor"') }}
39+ PUBLISH_ROUTER_CRATE : ${{ contains(needs.check.outputs.crates_to_publish, '"hive-router"') }}
40+ if : ${{ github.repository_owner == 'graphql-hive' && needs.check.outputs.crates_to_publish != '{}' }}
3741 steps :
3842 - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3943 - uses : actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
4044 with :
4145 cache : false
46+
4247 - name : authenticate with crates.io
4348 uses : rust-lang/crates-io-auth-action@v1
4449 id : auth
4550
4651 - name : publish config lib
47- if : env.CRATES_TO_PUBLISH.hive-router-config
52+ if : env.PUBLISH_CONFIG_CRATE == 'true'
4853 env :
4954 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
5055 run : |
51- cargo publish --manifest-path ${{ env.CRATES_TO_PUBLISH .hive-router-config }}
56+ cargo publish --manifest-path ${{ fromJson(needs.check.outputs.crates_to_publish) .hive-router-config }}
5257
5358 - name : publish query-planner lib
54- if : env.CRATES_TO_PUBLISH.hive-router-query-planner
59+ if : env.PUBLISH_QUERY_PLANNER_CRATE == 'true'
5560 env :
5661 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
5762 run : |
58- cargo publish --manifest-path ${{ env.CRATES_TO_PUBLISH .hive-router-query-planner }}
63+ cargo publish --manifest-path ${{ fromJson(needs.check.outputs.crates_to_publish) .hive-router-query-planner }}
5964
6065 - name : publish executor lib
61- if : env.CRATES_TO_PUBLISH.hive-router-plan-executor
66+ if : env.PUBLISH_EXECUTOR_CRATE == 'true'
6267 env :
6368 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
6469 run : |
65- cargo publish --manifest-path ${{ env.CRATES_TO_PUBLISH .hive-router-plan-executor }}
70+ cargo publish --manifest-path ${{ fromJson(needs.check.outputs.crates_to_publish) .hive-router-plan-executor }}
6671
6772 - name : publish router lib
68- if : env.CRATES_TO_PUBLISH.hive-router
73+ if : env.PUBLISH_ROUTER_CRATE == 'true'
6974 env :
7075 CARGO_REGISTRY_TOKEN : ${{ steps.auth.outputs.token }}
7176 run : |
72- cargo publish --manifest-path ${{ env.CRATES_TO_PUBLISH .hive-router }}
77+ cargo publish --manifest-path ${{ fromJson(needs.check.outputs.crates_to_publish) .hive-router }}
0 commit comments