cont. #53
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: 'Run the build with debug logging enabled' | |
required: false | |
default: false | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
release-type: rust | |
package-name: your-package-name | |
build: | |
name: Build and Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
rust: [stable] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
components: rustfmt, clippy | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --verbose | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --verbose | |
- name: Run clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
# - name: Check formatting | |
# run: | | |
# cargo clean && rm -rf rpc/src/generated/*.rs && cargo fmt -- --check $(find . -name '*.rs' -type f | grep -v "/generated/") | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }}-build | |
path: target/release/tappd-simulator* | |
- name: Debug log | |
if: ${{ github.event.inputs.debug_enabled == 'true' }} | |
run: | | |
echo "Debug logging enabled" | |
# 在这里添加您想要的任何额外的调试命令 | |
cargo --version | |
rustc --version | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ runner.os }}-build | |
path: target/release/* | |
upload-release-assets: | |
needs: [release-please, build] | |
runs-on: ubuntu-latest | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
- name: Calculate MD5 checksums | |
run: | | |
for artifact in *-build/*; do | |
md5sum "$artifact" >> checksums.md5 | |
done | |
- name: Upload Release Assets | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release upload ${{ needs.release-please.outputs.tag_name }} checksums.md5 *-build/* --clobber | |
- name: Debug log | |
if: ${{ github.event.inputs.debug_enabled == 'true' }} | |
shell: bash | |
run: | | |
echo "Debug logging enabled" | |
cargo --version | |
rustc --version | |
echo "Files being checked for formatting:" | |
find . -name '*.rs' -type f \ | |
! -path "./target/*" \ | |
! -path "*/generated/*" | |
echo "Rust edition in Cargo.toml:" | |
grep "edition" Cargo.toml | |