Improve heep #36
This file contains hidden or 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: | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: thumbv7m-none-eabi | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - run: python scripts/sync_code.py --check | |
| - run: cargo build --release --features=stm32f100,xC | |
| - run: python scripts/build.py build --release | |
| - run: python scripts/build.py clippy | |
| - run: python scripts/build.py test | |
| - run: python scripts/build.py build --example=f103c8 | |
| publish: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| environment: release # Optional: for enhanced security | |
| permissions: | |
| id-token: write # Required for OIDC token exchange | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: thumbv7m-none-eabi | |
| - name: Dry run | |
| if: github.ref_type != 'tag' | |
| run: cargo publish --features=stm32f103,xG --dry-run | |
| - uses: rust-lang/crates-io-auth-action@v1 | |
| if: github.ref_type == 'tag' | |
| id: auth | |
| - name: Publish crate | |
| if: github.ref_type == 'tag' | |
| run: cargo publish --features=stm32f103,xG | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} |