Skip to content

Commit 4cffb36

Browse files
committed
chore: fix release script
chore: fix release pipeline chore(release): fix release pipeline for Docker image tagging fix: release pipeline for crates chore(release): fix crate release pipeline (again...) fix again
1 parent 81b7f8b commit 4cffb36

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
router: patch
3+
---
4+
5+
# Trigger release pipeline to fix issues with 0.0.16 release

.github/release-crates-check.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@ publish_list=""
2626
while IFS=$'\t' read -r name version manifest_path; do
2727
echo "checking $name@$version (manifest: $manifest_path) ..."
2828

29-
cargo info "$name@$version" --registry crates-io
30-
EXIT_CODE=$?
31-
32-
if [ "$EXIT_CODE" -eq 0 ]; then
33-
echo " ✅ ALREADY PUBLISHED"
29+
if ! cargo info "$name@$version" --registry crates-io; then
30+
echo " [ ] NOT PUBLISHED"
31+
dir_name=$(dirname "$manifest_path")
32+
publish_list="${publish_list}${name}\t${dir_name}\n"
3433
else
35-
echo " [ ] NOT PUBLISHED"
36-
dir_name=$(dirname "$manifest_path")
37-
publish_list="${publish_list}${name}\t${dir_name}\n"
34+
echo " [x] ALREADY PUBLISHED"
3835
fi
3936
echo "---"
4037
done <<< "$CRATES_TO_CHECK"
@@ -53,5 +50,4 @@ echo "$CRATES_TO_PUBLISH_JSON" | jq .
5350
if [ -n "$GITHUB_OUTPUT" ]; then
5451
echo "Setting GitHub Actions output 'crates_to_publish'..."
5552
echo "crates_to_publish=$(echo "$CRATES_TO_PUBLISH_JSON" | jq -c .)" >> "$GITHUB_OUTPUT"
56-
echo "✅ GHA output set."
5753
fi

.github/workflows/build-router.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
tags: |
151151
type=ref,event=pr
152152
type=semver,pattern={{version}},value=${{ github.event.release.name }},enable=${{ github.event_name == 'release' && !github.event.release.prerelease }}
153-
type=match,group=1,pattern=router/v(.*),value=${{ github.event.release.name }},enable=${{ github.event_name == 'release' && !github.event.release.prerelease }}
153+
type=match,group=1,pattern=router/v(.*),value=${{ github.event.release.tag_name }},enable=${{ github.event_name == 'release' && !github.event.release.prerelease }}
154154
type=sha
155155
type=raw,value=latest,enable=${{ github.event_name == 'release' && !github.event.release.prerelease }}
156156
- name: download binary artifacts

.github/workflows/release-crates.yaml renamed to .github/workflows/release.yaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)