chore: add GA to publish tangle-subxt#1043
Conversation
|
Claude finished @1xstj's task —— View job PR Review AnalysisTodo List:
Comprehensive Code ReviewI've thoroughly analyzed the new GitHub Actions workflow for publishing ✅ Positive Aspects
🔧 Areas for ImprovementSecurity Considerations
Best Practices & Reliability
Performance & Efficiency
Documentation & Maintainability
🚨 Potential Issues
📋 Recommended Changes# Improved version check step
- name: Check if version changed
id: version-check
run: |
# Get the current version using cargo metadata (more reliable)
CURRENT_VERSION=$(cargo metadata --no-deps --format-version 1 --manifest-path tangle-subxt/Cargo.toml | jq -r '.packages[] | select(.name=="tangle-subxt") | .version')
echo "Current version: $CURRENT_VERSION"
# Check if this version already exists on crates.io with retry
for i in {1..3}; do
if cargo info tangle-subxt 2>/dev/null | grep -q "^$CURRENT_VERSION"; then
echo "Version $CURRENT_VERSION already exists on crates.io"
echo "should_publish=false" >> $GITHUB_OUTPUT
exit 0
fi
sleep 2
done
echo "Version $CURRENT_VERSION not found on crates.io, proceeding with publish"
echo "should_publish=true" >> $GITHUB_OUTPUT
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
# Improved publish step
- name: Publish to crates.io
if: steps.version-check.outputs.should_publish == 'true'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd tangle-subxt
cargo publish # Removed explicit token flag for security🔍 Additional Considerations
📊 Overall AssessmentThis workflow is functionally sound and follows many GitHub Actions best practices. The main concerns are around security (token handling), reliability (version checking), and error handling. The suggested improvements would make it more robust and maintainable. Recommendation: ✅ Approve with suggested improvements |
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes