Skip to content

Commit 9f928f4

Browse files
Merge pull request #8 from RusPiRo/master
Prepare Release and crates.io publishing
2 parents 8c677e3 + 05e773f commit 9f928f4

22 files changed

+391
-1246
lines changed

.travis.yml

Lines changed: 94 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,122 @@
33
branches:
44
only:
55
- master
6+
- release
67

78
language: rust
89

910
rust:
1011
# build nightly only for the time beeing
1112
- nightly
1213

13-
matrix:
14-
fast_finish: true
14+
# increase build speed by caching installed cargo dependencies
15+
cache: cargo
16+
17+
# define the stages and their order
18+
stages:
19+
- compile
20+
- test
21+
- publish_dry
22+
- name: prepare_release
23+
if: branch = master AND type != pull_request
24+
- name: deploy
25+
if: branch = release AND type != pull_request
26+
- name: publish
27+
if: branch = release AND type != pull_request
28+
29+
jobs:
1530
include:
16-
- name: "build 64Bit"
31+
- stage: compile
32+
name: "Compile The Crate"
1733
install:
18-
- sudo apt-get install gcc-aarch64-linux-gnu
34+
- sudo apt-get install -y gcc-aarch64-linux-gnu
1935
- cargo install cargo-xbuild
2036
- cargo install cargo-make
21-
- rustup target add aarch64-unknown-linux-gnu
37+
- rustup target add aarch64-unknown-none
2238
- rustup component add rust-src
2339
- rustup component add llvm-tools-preview
2440
# if we not build a PR we remove the patch of the dependencies to their github repo's
2541
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" Cargo.toml; fi'
26-
script: cargo make --profile a64-travis pi3
42+
script: cargo make --profile travis pi3
2743

28-
- name: "build 32Bit"
44+
- stage: test
45+
name: "Run Doc Tests"
2946
install:
30-
- sudo apt-get install -y gcc-arm-none-eabi
31-
- cargo install cargo-xbuild
3247
- cargo install cargo-make
33-
- rustup target add armv7-unknown-linux-gnueabihf
34-
- rustup component add rust-src
35-
- rustup component add llvm-tools-preview
3648
# if we not build a PR we remove the patch of the dependencies to their github repo's
3749
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" Cargo.toml; fi'
38-
script: cargo make --profile a32 pi3
39-
40-
- name: "unit tests"
50+
script: cargo make doctest --profile dummy
51+
- stage: test
52+
name: "Run Unit Tests"
4153
install:
54+
- cargo install cargo-make
4255
# if we not build a PR we remove the patch of the dependencies to their github repo's
4356
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" Cargo.toml; fi'
44-
script: cargo test --tests --features ruspiro_pi3
57+
script: cargo make unittest --profile dummy
4558

46-
- name: "doc tests"
59+
- stage: publish_dry
60+
name: "Run Cargo Publish Dry-Run"
4761
install:
48-
# if we not build a PR we remove the patch of the dependencies to their github repo's
49-
- 'if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then sed -i "/{^\[patch\.crates-io\] /{:a;N;/\Z}/!ba};/^ruspiro-.*\(git\|path\).*/d" Cargo.toml; fi'
50-
- cat Cargo.toml
51-
script: cargo test --doc --features ruspiro_pi3
62+
- sudo apt-get install -y gcc-aarch64-linux-gnu
63+
- cargo install cargo-xbuild
64+
- cargo install cargo-make
65+
- rustup target add aarch64-unknown-none
66+
- rustup component add rust-src
67+
- rustup component add llvm-tools-preview
68+
script: cargo make publish_dry --profile travis
69+
70+
- stage: prepare_release
71+
name: "Create PR against the release branch"
72+
script:
73+
- 'curl -H ''Authorization: Token ''"$GIT_API_TOKEN"'''' -X POST -H ''Content-type: application/json'' --data ''{"title":"Prepare Release and crates.io publishing", "head":"master", "base":"release", "draft":false, "body":"Automatic PR to the release branch as preperation to publish the library"}'' https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls > /dev/null'
74+
75+
- stage: deploy
76+
name: "Create GitHub release"
77+
78+
before_deploy:
79+
# extract current crate version from argo.toml
80+
- export CRATE_VERSION=v`sed -En 's/^version.*=.*\"(.*)\".*$/\1/p' < Cargo.toml`
81+
# retrieve last release version from github
82+
- export LAST_VERSION="$(curl --silent "https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')"
83+
# use default version if none yet published (required for proper release note extraction)
84+
- export LAST_VERSION=${LAST_VERSION:-v0.0.0}
85+
- echo $CRATE_VERSION
86+
- echo $LAST_VERSION
87+
- git config --local user.name "2ndTaleStudio"
88+
- git config --local user.email "[email protected]"
89+
# create the TAG required for the release
90+
- git tag $CRATE_VERSION -m "$CRATE_VERSION"
91+
# extract the release notes of the current release from the changelog
92+
- sed -En '/##.*:.*:.*'"$LAST_VERSION"'/q;p' CHANGELOG.md > RELEASENOTES.md
93+
- sed -i -e 's/^# Changelog/# Release Notes/g' RELEASENOTES.md
94+
deploy:
95+
provider: releases
96+
# use dpl v2 version for deployments to support the release_notes_file option
97+
edge: true
98+
api_key: "$GIT_API_TOKEN"
99+
name: "$CRATE_VERSION"
100+
release_notes_file: "RELEASENOTES.md"
101+
file: "RELEASENOTES.md"
102+
skip_cleanup: true
103+
on:
104+
branch: release
105+
106+
- stage: publish
107+
name: "Run Cargo Publish"
108+
install:
109+
- sudo apt-get install -y gcc-aarch64-linux-gnu
110+
- cargo install cargo-xbuild
111+
- cargo install cargo-make
112+
- rustup target add aarch64-unknown-none
113+
- rustup component add rust-src
114+
- rustup component add llvm-tools-preview
115+
# extract current crate version from argo.toml
116+
- export CRATE_VERSION=`sed -En 's/^version.*=.*\"(.*)\".*$/\1/p' < Cargo.toml`
117+
# before actually publishing replace the final version for doc and repository in the Crago.toml
118+
- sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' Cargo.toml
119+
# also update the version in the lib.rs doc root url
120+
- sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' src/lib.rs
121+
# and the README.md
122+
- sed -i -e 's/||VERSION||/'$CRATE_VERSION'/g' README.md
123+
# publish with token and dirty flag as we just updated some files and won't commit them back to the branch
124+
script: cargo make publish --env CRATES_TOKEN="$CRATES_TOKEN" > /dev/null

CHANGELOG.md

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,51 @@
11
# Changelog
2+
3+
## :peach: v0.4.0
4+
5+
Refactoring the crate into a more lightweight 64Bit only version. This now provides a tailormade lean implementation to boot up the Raspberry Pi either in *multicore* or *singlecore* setup. The boot sequence hands processing to an entry functions that needs to be implemented by the user of this crate. The implementer of this entry point function does have now full freedom where to go from here. As part of the boot sequence there is nomore a forced setup of the MMU or any other peripheral.
6+
7+
- ### :wrench: Maintenance
8+
9+
- use a proper travis-ci pipeline setup
10+
- remove aarch32 support during boot up
11+
- instead of the feature `singlecore` to prevent multicore boot up, the default is now single-core and the feature `multicore` enables multi-core boot up
12+
- a conditional compilation flag ensures this crate does only build with useful content if the target architecture is *Aarch64*
13+
214
## :banana: v0.3.2
3-
- ### :wrench: Maintenance
4-
- use `cargo make` to stabilize build
5-
- change usage of `asm!` macro into `llvm_asm!`
15+
16+
- ### :wrench: Maintenance
17+
18+
- use `cargo make` to stabilize build
19+
- change usage of `asm!` macro into `llvm_asm!`
620

721
## :apple: v0.3.1
8-
- ### :bulb: Features
9-
- add some console log statements in the panic handler that gives a clue of the panic when at least
10-
the console could be setup properly before panicing the first time :)
11-
- use Raspberry Pi Mailbox to retrieve clock speed to initialize miniUart with
12-
- ### :detective: Fixes
13-
- Fix the path created by the build script pointing to the linker script file. It should not contain a '\\\\'.
14-
In addition the examples for the build script to be implementend on consumer side was updated.
15-
- Fix issues with the exception calls and returns as several registers where trashed that
16-
should have been preserved
17-
18-
- ### :wrench: Maintenance
19-
- Use additional ``cfg`` and ``cfg_attr`` to enable running ``cargo test`` which requires some functions from ``std``.
20-
- Update to latest ``ruspiro-register`` version
21-
- Remove ``ruspiro-gpio`` dependency
22-
- Remove the ``ruspiro_interrupt`` dependencie to let the using crate decide whether to incorporate
23-
interrupt handling or not. This than also includes the crate introducing interrupt handling usage need to
24-
proper initialize interrupt handling.
25-
26-
27-
22+
23+
- ### :bulb: Features
24+
25+
- add some console log statements in the panic handler that gives a clue of the panic when at least the console could be setup properly before panicing the first time :)
26+
- use Raspberry Pi Mailbox to retrieve clock speed to initialize miniUart with
27+
28+
- ### :detective: Fixes
29+
30+
- Fix the path created by the build script pointing to the linker script file. It should not contain a '\\\\'. In addition the examples for the build script to be implementend on consumer side was updated.
31+
- Fix issues with the exception calls and returns as several registers where trashed that should have been preserved
32+
33+
- ### :wrench: Maintenance
34+
35+
- Use additional ``cfg`` and ``cfg_attr`` to enable running ``cargo test`` which requires some functions from ``std``.
36+
- Update to latest ``ruspiro-register`` version
37+
- Remove ``ruspiro-gpio`` dependency
38+
- Remove the ``ruspiro_interrupt`` dependencie to let the using crate decide whether to incorporate interrupt handling or not. This than also includes the crate introducing interrupt handling usage need to proper initialize interrupt handling.
39+
2840
## :carrot: v0.3.0
29-
- ### :bulb: Features
30-
Refactor the boot strapping code to support `Aarch32` and `Aarch64` build target architectures.
31-
32-
The boot strapping code is run at the very first moment the Raspberry Pi boots up and the GPU
33-
hands over execution to the CPU. The boot strapper could be built to run in `singlecore` mode.
34-
35-
The boot strapping switches all cores into exception level EL1(aarch64)/SVC(aarch32) and
36-
initializes the MMU with a default 1:1 mapping accross the whole available memory.
37-
38-
The boot strapping also sets up exception handling and provides a generic default exception
39-
handler that is ready to be implemented by the user of this crate.
40-
41-
The miniUart of the Raspberry Pi is initialized and attached to the global CONSOLE which enables
42-
users of this crate to use the macros `print!`and `println!` to conviniently write to the uart console. The feature
43-
set of both macros is equivalent to the `rust_std` versions.
41+
42+
- ### :bulb: Features
43+
Refactor the boot strapping code to support `Aarch32` and `Aarch64` build target architectures.
44+
45+
The boot strapping code is run at the very first moment the Raspberry Pi boots up and the GPU hands over execution to the CPU. The boot strapper could be built to run in `singlecore` mode.
46+
47+
The boot strapping switches all cores into exception level EL1(aarch64)/SVC(aarch32) and initializes the MMU with a default 1:1 mapping accross the whole available memory.
48+
49+
The boot strapping also sets up exception handling and provides a generic default exception handler that is ready to be implemented by the user of this crate.
50+
51+
The miniUart of the Raspberry Pi is initialized and attached to the global CONSOLE which enables users of this crate to use the macros `print!`and `println!` to conviniently write to the uart console. The feature set of both macros is equivalent to the `rust_std` versions.

CONTRIBUTING.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Contributing to RusPiRo Crates
2+
3+
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
4+
5+
## We Develop with Github and use [Github Flow](https://guides.github.com/introduction/flow/index.html)
6+
7+
We use github to host code, to track issues and feature requests. Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:
8+
9+
1. Fork the repo and create your branch from `master`.
10+
2. Implement your changes.
11+
3. Run `cargo fmt` and `cargo clippy` to ensure consistant code style
12+
4. If applicable provide unit tests
13+
5. Properly document code and provide doc examples that pass the doc tests
14+
6. Issue that pull request!
15+
7. It would be a big plus if you own a Raspberry PI 3B+ to test the code on actual hardware. Running tests with QEMU are also acceptable.
16+
17+
## Any contributions you make will be double licensed under MIT and/or Apache 2.0 Software License
18+
19+
In short, when you submit code changes, your submissions are understood to be under the same double license ([APACHE License](http://www.apache.org/licenses/LICENSE-2.0) OR [MIT License](http://choosealicense.com/licenses/mit/)) that covers the project. Feel free to contact the maintainers if that's a concern.
20+
21+
## Code of Conduct
22+
23+
### Our Pledge
24+
25+
In the interest of fostering an open and welcoming environment, we as
26+
contributors and maintainers pledge to making participation in our project and
27+
our community a harassment-free experience for everyone, regardless of age, body
28+
size, disability, ethnicity, gender identity and expression, level of experience,
29+
nationality, personal appearance, race, religion, or sexual identity and
30+
orientation.
31+
32+
### Our Standards
33+
34+
Examples of behavior that contributes to creating a positive environment
35+
include:
36+
37+
* Using welcoming and inclusive language
38+
* Being respectful of differing viewpoints and experiences
39+
* Gracefully accepting constructive criticism
40+
* Focusing on what is best for the community
41+
* Showing empathy towards other community members
42+
43+
Examples of unacceptable behavior by participants include:
44+
45+
* The use of sexualized language or imagery and unwelcome sexual attention or
46+
advances
47+
* Trolling, insulting/derogatory comments, and personal or political attacks
48+
* Public or private harassment
49+
* Publishing others' private information, such as a physical or electronic
50+
address, without explicit permission
51+
* Other conduct which could reasonably be considered inappropriate in a
52+
professional setting
53+
54+
### Our Responsibilities
55+
56+
Project maintainers are responsible for clarifying the standards of acceptable
57+
behavior and are expected to take appropriate and fair corrective action in
58+
response to any instances of unacceptable behavior.
59+
60+
Project maintainers have the right and responsibility to remove, edit, or
61+
reject comments, commits, code, wiki edits, issues, and other contributions
62+
that are not aligned to this Code of Conduct, or to ban temporarily or
63+
permanently any contributor for other behaviors that they deem inappropriate,
64+
threatening, offensive, or harmful.
65+
66+
### Scope
67+
68+
This Code of Conduct applies both within project spaces and in public spaces
69+
when an individual is representing the project or its community. Examples of
70+
representing a project or community include using an official project e-mail
71+
address, posting via an official social media account, or acting as an appointed
72+
representative at an online or offline event. Representation of a project may be
73+
further defined and clarified by project maintainers.
74+
75+
### Enforcement
76+
77+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
78+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
79+
complaints will be reviewed and investigated and will result in a response that
80+
is deemed necessary and appropriate to the circumstances. The project team is
81+
obligated to maintain confidentiality with regard to the reporter of an incident.
82+
Further details of specific enforcement policies may be posted separately.
83+
84+
Project maintainers who do not follow or enforce the Code of Conduct in good
85+
faith may face temporary or permanent repercussions as determined by other
86+
members of the project's leadership.
87+
88+
### Attribution
89+
90+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
91+
available at [http://contributor-covenant.org/version/1/4][version]
92+
93+
[homepage]: http://contributor-covenant.org
94+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)