-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into posterzh/get-firmware-version
- Loading branch information
Showing
15 changed files
with
272 additions
and
108 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
* @NebraLtd/developers | ||
|
||
# See example for more details: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners#example-of-a-codeowners-file |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# How to contriubte | ||
|
||
Thanks for your interest in contributing to Nebra. We enforce certain rules on commits with the following goals in mind: | ||
|
||
- Be able to reliably auto-generate the `CHANGELOG.md` *without* any human intervention. | ||
- Be able to automatically and correctly increment the semver version number based on what was done since the last release. | ||
- Be able to get a quick overview of what happened to the project by glancing over the commit history. | ||
- Be able to automatically reference relevant changes from a dependency upgrade. | ||
|
||
Our CI will run checks to ensure this guidelines are followed and won't allow merging contributions that don't adhere to them. Version number and changelog are automatically handled by the CI build flow after a pull request is merged. You only need to worry about the commit itself. | ||
|
||
## Commit structure | ||
|
||
Each commit message should consist of a header a body and a footer, structured in the following format: | ||
|
||
``` | ||
<scope (optional)>: <subject (mandatory)> | ||
--BLANK LINE-- | ||
(optional) <body> | ||
--BLANK LINE-- | ||
(optional) Connects-to: #issue-number | ||
(optional) Closes: #issue-number | ||
(mandatory) Change-type: major | minor | patch | ||
(optional) Signed-off-by: Foo Bar <[email protected]> | ||
``` | ||
|
||
Note that: | ||
- Blank lines are required to separate header from body and body from footer. You don't need to add two blank lines if you don't add a body. | ||
- `scope`: If your commit touches a well defined component/part/service please addthe scope tag to clarify. Some examples: `docs`, `images`, `typos`. | ||
- `subject`: The subject should contain a short description of the change. Use the imperative, present tense. | ||
- `body`: A detailed description of changes being made and reasoning if necessary. This may contain several paragraphs. | ||
- `Connects-to`: If your commit is connected to an existing issue, link it by adding this tag with `#issue-number`. Example: `Connects-to: #123` | ||
- `Closes`: If your commit fixes an existing issue, link it by adding this tag with `#issue-number`. Example: `Closes: #123` | ||
- `Change-type`: At least one of your commits on a PR needs to have this tag. You have the flexibility, and it's good practise, to use this tag in as many commits as you see fit; in the end, the resulting change type for the scope of the PR will be folded down to the biggest one as marked in the commits (`major>minor>patch`). Our version numbering adheres to [Semantic Versioning](http://semver.org/). | ||
- `Signed-off-by`: Sign your commits by providing your full name and email address in the format: `Name Surname <[email protected]>`. *This is an optional tag.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
**Why** | ||
<!-- What is the objective of this work? --> | ||
|
||
**How** | ||
<!-- What steps were taken in this work? --> | ||
<!-- Its encouraged to copy information from other places even if it seems redundant --> | ||
|
||
**References** | ||
<!-- Links to related issues, relevant documentation, etc. --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Periodically check for updates, build and release gateway-mfr-rs | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 0" # Run weekly on sunday at 00:00 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
rust-compile: | ||
name: Build gateway-mfr-rs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Get Latest Release | ||
id: latest_version | ||
uses: abatilo/[email protected] | ||
with: | ||
owner: helium | ||
repo: gateway-mfr-rs | ||
- name: Perform check and update | ||
env: | ||
LATEST_GA: ${{ steps.latest_version.outputs.latest_tag }} | ||
run: | | ||
GITHUB_BRANCH=$( echo "${{ github.ref }}" | sed 's/refs\/heads\///g' ) | ||
|
||
echo "LATEST_GA=$LATEST_GA" >> $GITHUB_ENV | ||
echo "GITHUB_BRANCH=$GITHUB_BRANCH" >> $GITHUB_ENV | ||
|
||
# Get the latest GA release | ||
if grep -q "$LATEST_GA" Dockerfile; then | ||
echo "We're on the latest Helium gateway-rs release $LATEST_GA." | ||
exit 0 | ||
else | ||
echo "We're not on the latest Helium gateway-rs release. Updating to $LATEST_GA." | ||
sed -i -E '2 s/GATEWAY_RS_RELEASE=.*/GATEWAY_RS_RELEASE='$LATEST_GA'/g' Dockerfile | ||
UPDATED=true | ||
echo "UPDATED=$UPDATED" >> $GITHUB_ENV | ||
exit 0 | ||
fi | ||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: aarch64-unknown-linux-musl | ||
override: true | ||
|
||
- name: Clone repo | ||
env: | ||
LATEST_GA: ${{ steps.latest_version.outputs.latest_tag }} | ||
run: | | ||
git clone --branch $LATEST_GA https://github.com/helium/gateway-mfr-rs.git . | ||
- name: Run cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: true | ||
command: check | ||
|
||
- name: Build gateway-mfr-rs | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
use-cross: true | ||
command: build | ||
args: --target aarch64-unknown-linux-musl --release | ||
|
||
- name: Copy release file | ||
run: | | ||
cp ./target/aarch64-unknown-linux-musl/release/gateway_mfr gateway_mfr | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: gateway_mfr | ||
path: ./gateway_mfr |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,12 @@ jobs: | |
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: aarch64-unknown-linux-musl | ||
target: arm-unknown-linux-gnueabihf | ||
override: true | ||
|
||
- name: Clone repo | ||
run: | | ||
git clone --branch v0.1.3 https://github.com/helium/gateway-mfr-rs.git . | ||
git clone --branch v0.1.5 https://github.com/helium/gateway-mfr-rs.git . | ||
- name: Run cargo check | ||
uses: actions-rs/cargo@v1 | ||
|
@@ -32,11 +32,11 @@ jobs: | |
with: | ||
use-cross: true | ||
command: build | ||
args: --target aarch64-unknown-linux-musl --release | ||
args: --target arm-unknown-linux-gnueabihf --release | ||
|
||
- name: Copy release file | ||
run: | | ||
cp ./target/aarch64-unknown-linux-musl/release/gateway_mfr gateway_mfr | ||
cp ./target/arm-unknown-linux-gnueabihf/release/gateway_mfr gateway_mfr | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
|
@@ -81,6 +81,22 @@ jobs: | |
with: | ||
name: wheels | ||
path: ./dist/* | ||
|
||
- name: Get Latest Release | ||
id: latest_version | ||
uses: abatilo/[email protected] | ||
with: | ||
owner: NebraLtd | ||
repo: hm-pyhelper | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ./dist/* | ||
tag: ${{ steps.latest_version.outputs.latest_tag }} | ||
overwrite: true | ||
file_glob: true | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class MalformedRegionException(Exception): | ||
pass | ||
|
||
|
||
class SPIUnavailableException(Exception): | ||
pass |
File renamed without changes.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.