[db] Fix clippy warnings from Rust 1.74.0 #779 (#781) #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: [main] | |
paths: | |
- agdb/** | |
- agdb_derive/** | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: cargo build --package agdb_derive --package agdb --release | |
new_version: | |
runs-on: ubuntu-latest | |
outputs: | |
new_version: ${{ steps.new_version.outputs.new_version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: new_version | |
run: | | |
PUBLISHED_VERSION=$(cargo search ^agdb$ --limit 1 -q | head -n 1 | cut -d '"' -f 2) | |
CURRENT_VERSION=$(cat agdb/Cargo.toml | grep version | head -n 1 | cut -d '"' -f 2) | |
if [[ "${PUBLISHED_VERSION}" != "${CURRENT_VERSION}" ]]; then echo "new_version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT; fi | |
echo "Published version: ${PUBLISHED_VERSION}" | |
echo "Current version: ${CURRENT_VERSION}" | |
release: | |
runs-on: ubuntu-latest | |
needs: [build, new_version] | |
if: needs.new_version.outputs.new_version != '' | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git tag -a "v${{ needs.new_version.outputs.new_version }}" -m "Release version ${{ needs.new_version.outputs.new_version }}" | |
git push origin "v${{ needs.new_version.outputs.new_version }}" | |
- uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v${{ needs.new_version.outputs.new_version }} | |
generate_release_notes: true | |
publish: | |
runs-on: ubuntu-latest | |
needs: [release, new_version] | |
if: needs.new_version.outputs.new_version != '' | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
cargo publish --package agdb_derive --token ${CRATES_IO_TOKEN} | |
cargo publish --package agdb --token ${CRATES_IO_TOKEN} | |
env: | |
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |