Skip to content

Commit

Permalink
ported from semtech-udp example
Browse files Browse the repository at this point in the history
  • Loading branch information
lthiery committed Mar 23, 2022
1 parent 655f128 commit ad5436b
Show file tree
Hide file tree
Showing 6 changed files with 1,320 additions and 0 deletions.
161 changes: 161 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Continuous Integration

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
components: clippy, rustfmt

- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Check formatting
run: cargo fmt -- --check

- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

- name: Unit tests
run: cargo test

- name: Build
run: cargo build --all --release

- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo ::set-output name=RELEASE::gwmp-mux-${GITHUB_REF/refs\/tags\//}-x86-64-linux

- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $NAME
mv target/release/gwmp-mux $NAME/
cp README.md $NAME/
cp LICENSE $NAME/
tar -zcvf $NAME.tar.gz $NAME/
sha256sum -b --tag $NAME.tar.gz > $NAME.checksum
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.tar.gz
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


build-mac:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-apple-darwin
default: true
override: true

- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Build
run: cargo build --all --release

- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo ::set-output name=RELEASE::gwmp-mux-${GITHUB_REF/refs\/tags\//}-x86-64-macos

- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $NAME
mv target/release/gwmp-mux $NAME/
cp README.md $NAME/
cp LICENSE $NAME/
gtar -zcvf $NAME.tar.gz $NAME/
shasum -a 256 -b --tag $NAME.tar.gz > $NAME.checksum
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.tar.gz
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


build-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-gnu
default: true
override: true

- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Build
run: cargo build --all --release

- name: Name Release
if: startsWith(github.ref, 'refs/tags/')
id: name_release
run: echo ::set-output name=RELEASE::gwmp-mux-${GITHUB_REF/refs\/tags\//}-x86-64-win
shell: bash

- name: Prepare Release
if: startsWith(github.ref, 'refs/tags/')
env:
NAME: ${{ steps.name_release.outputs.RELEASE }}
run: |
mkdir $env:NAME
mv target/release/gwmp-mux.exe $env:NAME/
cp README.md $env:NAME/
cp LICENSE $env:NAME/
7z a "$env:NAME.zip" "$env:NAME/"
certUtil -hashfile "$env:NAME.zip" SHA256 > "$env:NAME.checksum"
- name: Push Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ steps.name_release.outputs.RELEASE }}.zip
${{ steps.name_release.outputs.RELEASE }}.checksum
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to Contribute to this repository #

We value contributions from the community and will do everything we
can go get them reviewed in a timely fashion. If you have code to send
our way or a bug to report:

* **Contributing Code**: If you have new code or a bug fix, fork this
repo, create a logically-named branch, and [submit a PR against this
repo](https://github.com/helium/gwmp-mux/issues). Include a
write up of the PR with details on what it does.

* **Reporting Bugs**: Open an issue [against this
repo](https://github.com/helium/gwmp-mux/issues) with as much
detail as you can. At the very least you'll include steps to
reproduce the problem.

This project is intended to be a safe, welcoming space for
collaboration, and contributors are expected to adhere to the
[Contributor Covenant Code of
Conduct](http://contributor-covenant.org/).

Above all, thank you for taking the time to be a part of the Helium community.

Loading

0 comments on commit ad5436b

Please sign in to comment.