Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ jobs:
path: artifacts
pattern: java-bindings-*
- name: Import PGP key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v7
with:
gpg_private_key: ${{ secrets.SFIO_PGP_PRIVATE_KEY }}
Expand Down Expand Up @@ -389,10 +390,12 @@ jobs:
cp java-bindings-jar/rodbus-${{github.ref_name}}-sources.jar io/stepfunc/rodbus/${{github.ref_name}}/
cp java-bindings-jar/rodbus-${{github.ref_name}}-javadoc.jar io/stepfunc/rodbus/${{github.ref_name}}/

# Sign all files
# Sign all files. v7 of ghaction-import-gpg does not configure a default
# signing key, so select it explicitly by fingerprint (the action's
# recommended user ID) to avoid "no default secret key" errors.
cd io/stepfunc/rodbus/${{github.ref_name}}
for file in *.jar *.pom; do
gpg --batch --yes --pinentry-mode loopback --passphrase "${{ secrets.SFIO_PGP_PRIVATE_KEY_PASSPHRASE }}" --armor --detach-sign "$file"
gpg --batch --yes --pinentry-mode loopback --local-user "${{ steps.import_gpg.outputs.fingerprint }}" --passphrase "${{ secrets.SFIO_PGP_PRIVATE_KEY_PASSPHRASE }}" --armor --detach-sign "$file"
done

# Generate checksums
Expand Down Expand Up @@ -469,10 +472,14 @@ jobs:
- name: Publish to crates.io
shell: bash
run: |
# Check if version already exists on crates.io
# Authoritative existence check via the sparse index (the same source
# cargo reads) so re-running the release is idempotent. Each line is one
# published version as compact JSON. This avoids the crates.io web API,
# which 403s on default curl User-Agents. If the version is absent we
# publish, and any cargo failure is a genuine failure.
VERSION=${{github.ref_name}}
if curl -f -s "https://crates.io/api/v1/crates/rodbus/$VERSION" > /dev/null 2>&1; then
echo "✅ rodbus $VERSION already published to crates.io - skipping"
if curl -sf "https://index.crates.io/ro/db/rodbus" | grep -qF "\"vers\":\"$VERSION\""; then
echo "✅ rodbus $VERSION already on crates.io - skipping"
else
echo "Publishing rodbus $VERSION to crates.io..."
cargo publish -p rodbus --token ${{ secrets.CRATES_PUBLISH_TOKEN }}
Expand Down
Loading