diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10fb0be..251475f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,18 +23,18 @@ jobs: profile: minimal toolchain: nightly override: true - components: rustfmt, clippy, rust-src, llvm-tools-preview - target: aarch64-unknown-none + components: rust-src, llvm-tools-preview + target: aarch64-unknown-linux-gnu - name: Install Cargo Make uses: davidB/rust-cargo-make@v1 with: version: 'latest' - - if: ${{ github.event_name != 'pull_request' }} - name: Remove patches if not a PR build - run: | - sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" ./interrupt/Cargo.toml; + # - if: ${{ github.event_name != 'pull_request' }} + # name: Remove patches if not a PR build + # run: | + # sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" ./interrupt/Cargo.toml; - name: Compile run: | @@ -56,18 +56,23 @@ jobs: profile: minimal toolchain: nightly override: true - components: rustfmt, clippy, rust-src, llvm-tools-preview - target: aarch64-unknown-none + components: rust-src, llvm-tools-preview + target: aarch64-unknown-linux-gnu - name: Install Cargo Make uses: davidB/rust-cargo-make@v1 with: version: 'latest' - - name: Publish-Dry-Run + - name: Publish-Dry-Run-Macros run: | - cd ./interrupt + cd ./macros cargo make publish_dry + # As interrupt depend on macros it's dry run would always fail + # as the dry run expects all dependencies to be available at crates.io + # already ! + # cd ../interrupt + # cargo make publish_dry --profile pipeline prepare_release: needs: [build, publish_dry] @@ -135,10 +140,10 @@ jobs: draft: false prerelease: false - publish: + publish-macros: if: ${{ github.ref == 'refs/heads/release' }} needs: deploy - name: Run Cargo Publish + name: Run Cargo Publish for Macros runs-on: ubuntu-latest steps: @@ -152,8 +157,48 @@ jobs: profile: minimal toolchain: nightly override: true - components: rustfmt, clippy, rust-src, llvm-tools-preview - target: aarch64-unknown-none + components: rust-src, llvm-tools-preview + target: aarch64-unknown-linux-gnu + + - name: Install Cargo Make + uses: davidB/rust-cargo-make@v1 + with: + version: 'latest' + + - name: Get current version + run: echo 'CRATE_VERSION='$(sed -En 's/^version.*=.*\"(.*)\".*$/\1/p' < ./macros/Cargo.toml) >> $GITHUB_ENV + + - name: Update version place holder in files + run: | + # before actually publishing replace the final version for doc and repository in the Crago.toml + sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' ./macros/Cargo.toml + # also update the version in the lib.rs doc root url + sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' ./macros/src/lib.rs + + - name: Publish-Run + run: | + cd ./macros/ + cargo make publish --env CRATES_TOKEN=${{ secrets.CRATES_TOKEN }} --profile pipeline + + publish-interrups: + if: ${{ github.ref == 'refs/heads/release' }} + needs: [deploy, publish-macros] + name: Run Cargo Publish Interrupts + runs-on: ubuntu-latest + + steps: + # Checkout the current code from github into the CI machine + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Rust Nightly and Cargo + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: rust-src, llvm-tools-preview + target: aarch64-unknown-linux-gnu - name: Install Cargo Make uses: davidB/rust-cargo-make@v1 @@ -167,12 +212,17 @@ jobs: run: | # before actually publishing replace the final version for doc and repository in the Crago.toml sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' ./interrupt/Cargo.toml - sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' ./macros/Cargo.toml # also update the version in the lib.rs doc root url sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' ./interrupt/src/lib.rs # and the README.md sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' README.md + # as macros are published now - do the dry run for interrupt followed by the real publish + - name: Publish-Dry-Run + run: | + cd ./interrupt/ + cargo make publish_dry --profile pipeline + - name: Publish-Run run: | cd ./interrupt/ diff --git a/interrupt/Cargo.toml b/interrupt/Cargo.toml index 4716323..a0d2784 100644 --- a/interrupt/Cargo.toml +++ b/interrupt/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ruspiro-interrupt" authors = ["Andre Borrmann "] -version = "0.4.1" # remember to update html_root_url +version = "0.4.2" # remember to update html_root_url description = """ Providing a simple and convinient way to implement interrupt handler for Raspberry Pi interrupts. """ @@ -25,11 +25,11 @@ maintenance = { status = "actively-developed" } paste = "~1.0" futures-util = { version = "~0.3", default-features = false, optional = true } ruspiro-mmio-register = "~0.1" -ruspiro-interrupt-macros = "~0.2" +ruspiro-interrupt-macros = { path = "../macros", version = "~0.3" } ruspiro-singleton = "~0.4" ruspiro-channel = "~0.1" - [features] ruspiro_pi3 = [] async = ["futures-util", "ruspiro-interrupt-macros/async", "ruspiro-channel/async" ] + diff --git a/interrupt/Makefile.toml b/interrupt/Makefile.toml index 15f9dcf..4724800 100644 --- a/interrupt/Makefile.toml +++ b/interrupt/Makefile.toml @@ -9,8 +9,8 @@ AR = "aarch64-none-elf-ar" CFLAGS = "-march=armv8-a -Wall -O3 -nostdlib -nostartfiles -ffreestanding -mtune=cortex-a53" RUSTFLAGS = "-C linker=${CC} -C target-cpu=cortex-a53 -C link-arg=-nostartfiles -C link-arg=-T./link64.ld" -# AARCH64 specific Travis CI env. variables. "aarch64-none-elf" is not available there as it seems -[env.travis] +# AARCH64 specific Pipeline env. variables. "aarch64-none-elf" is not available there as it seems +[env.pipeline] CC = "aarch64-linux-gnu-gcc" AR = "aarch64-linux-gnu-ar" CFLAGS = "-march=armv8-a -Wall -O3 -nostdlib -nostartfiles -ffreestanding -mtune=cortex-a53" diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 7c5223d..b0a28e0 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ruspiro-interrupt-macros" authors = ["Andre Borrmann "] -version = "0.2.2" # remember to update html_root_url +version = "0.3.1" # remember to update html_root_url description = """ Macros used to implement interrupt handler. !!This crate is only useful in conjunction with the `ruspiro-interrupt` crate and shall never be used standalone!! diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 28d8bf2..5e547e1 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -4,7 +4,7 @@ * Author: André Borrmann * License: Apache License 2.0 **********************************************************************************************************************/ -#![doc(html_root_url = "https://docs.rs/ruspiro-interrupt-macros/0.2.2")] +#![doc(html_root_url = "https://docs.rs/ruspiro-interrupt-macros/||VERSION||")] //! # Interrupt Macros //! @@ -105,7 +105,9 @@ pub fn IrqHandler(attr: TokenStream, item: TokenStream) -> TokenStream { #[export_name = #irq_name_s] #(#attrs)* #[no_mangle] - pub unsafe extern "C" fn #ident(tx: Option>>) { + pub unsafe extern "C" fn #ident( + tx: Option>> + ) { // force compiler error if the irq_name does not appear in the Interrupt enum that need to be // referred to in the crate using this attribute ruspiro_interrupt::Interrupt::#irq_name;