Skip to content

Commit dba54b1

Browse files
committed
fix(ci): tolerate already-published validators crate
1 parent be3d5f2 commit dba54b1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/publish-crate.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,21 @@ jobs:
6565
- name: Publish aviso-validators
6666
run: |
6767
set -euo pipefail
68+
ERR_FILE="${RUNNER_TEMP}/publish-validators.err"
6869
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.dry_run }}" = "true" ]; then
6970
cargo publish --manifest-path aviso-validators/Cargo.toml --dry-run
7071
else
71-
cargo publish --manifest-path aviso-validators/Cargo.toml
72+
if cargo publish --manifest-path aviso-validators/Cargo.toml 2>"${ERR_FILE}"; then
73+
exit 0
74+
fi
75+
76+
if grep -q 'already exists on crates.io index' "${ERR_FILE}"; then
77+
echo "aviso-validators is already published for this version; continuing."
78+
exit 0
79+
fi
80+
81+
cat "${ERR_FILE}" >&2
82+
exit 1
7283
fi
7384
7485
publish-server:

0 commit comments

Comments
 (0)