diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index cfe7649..158b689 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -31,6 +31,6 @@ If applicable, add screenshots to help explain your problem. Add any other context about the problem here. * You should not have a compilation error if you use the versions of the libraries linked into the libraries folder, this badges show you the state of the compilation -[![Build Status](https://travis-ci.com/1technophile/OpenMQTTGateway.svg?branch=master)](https://travis-ci.com/1technophile/OpenMQTTGateway) +[![Build Status](https://github.com/1technophile/OpenMQTTGateway/workflows/Build/badge.svg?branch=master)](https://github.com/1technophile/OpenMQTTGateway/actions) * If you are not sure this is a bug or an enhancement post your question to the forum below [![Community forum](https://img.shields.io/badge/community-forum-brightgreen.svg)](https://community.openmqttgateway.com) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0ea1352 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + name: Build with PlatformIO + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Install platformio + run: | + python -m pip install --upgrade pip + pip install platformio + - name: Run PlatformIO + run: platformio run + + documentation: + runs-on: ubuntu-latest + name: Create the documentation + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: "14.x" + - name: Install vuepress + run: npm install -g vuepress + - name: Build documentation + run: npm run docs:build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6609b38 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,62 @@ +name: Release + +on: + release: + types: [published] + +jobs: + build-upload: + runs-on: ubuntu-latest + name: Build and upload Assets to Release + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Install platformio + run: | + python -m pip install --upgrade pip + pip install platformio + - name: Set version tag from git + run: sed -i "s/version_tag/${GITHUB_REF#refs/tags/}/g" main/User_config.h + - name: Run PlatformIO + run: platformio run + - name: Prepare Release Assets + run: | + sudo apt install rename + ./scripts/prepare_deploy.sh + - name: Get upload url + id: release-id + run: | + RELEASE_ID=$(jq --raw-output '.release.id' $GITHUB_EVENT_PATH) + echo "::set-output name=upload_url::https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets{?name,label}" + - name: Upload Release Assets + uses: bgpat/release-asset-action@03b0c30db1c4031ce3474740b0e4275cd7e126a3 + with: + pattern: "toDeploy/*" + github-token: ${{ secrets.GITHUB_TOKEN }} + release-url: ${{ steps.release-id.outputs.upload_url }} + allow-overwrite: true + + documentation: + runs-on: ubuntu-latest + name: Create the documentation and deploy it to GitHub Pages + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v1 + with: + node-version: "14.x" + - name: Install vuepress + run: npm install -g vuepress + - name: Set version tag from git + run: sed -i "s/version_tag/${GITHUB_REF#refs/tags/}/g" docs/.vuepress/config.js + - name: Build documentation + run: npm run docs:build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/.vuepress/dist + cname: docs.openmqttgateway.com diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6cad869..0000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -# Continuous Integration (CI) is the practice, in software -# engineering, of merging all developer working copies with a shared mainline -# several times a day < https://docs.platformio.org/page/ci/index.html > -# -# Documentation: -# -# * Travis CI Embedded Builds with PlatformIO -# < https://docs.travis-ci.com/user/integration/platformio/ > -# -# * PlatformIO integration with Travis CI -# < https://docs.platformio.org/page/ci/travis.html > -# -# * User Guide for `platformio ci` command -# < https://docs.platformio.org/page/userguide/cmd_ci.html > -# -# -# Please choose one of the following templates (proposed below) and uncomment -# it (remove "# " before each line) or use own configuration according to the -# Travis CI documentation (see above). -# - -# -# Template #1: General project. Test it using existing `platformio.ini`. -# -jobs: - include: - - name: "Build and deploy with PlatformIO" - language: python - python: 2.7 - cache: - directories: - - "~/.platformio" - install: - - pip install -U platformio - - platformio update - script: - - sed -i 's/version_tag/'$TRAVIS_TAG'/g' main/User_config.h - - platformio run - - bash scripts/prepare_deploy.sh - before_deploy: ls -a - deploy: - on: - repo: 1technophile/OpenMQTTGateway - all_branches: true - tags: true - provider: releases - overwrite: true - api_key: $GITHUB_TOKEN - file_glob: true - file: - - toDeploy/* - skip_cleanup: true - - - name: "Build and deploy docs" - language: node_js - node_js: - - lts/* - install: - - npm install -g vuepress - script: - - sed -i 's/version_tag/'$TRAVIS_TAG'/g' docs/.vuepress/config.js - - npm run docs:build - before_deploy: echo "docs.openmqttgateway.com" >> docs/.vuepress/dist/CNAME - deploy: - provider: pages - skip_cleanup: true - local_dir: docs/.vuepress/dist - github_token: $GITHUB_TOKEN # a token generated on github allowing travis to push code on you repository - keep_history: true - on: - repo: 1technophile/OpenMQTTGateway - all_branches: true - tags: true diff --git a/README.md b/README.md index da3fac1..c0745d8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Community forum](https://img.shields.io/badge/community-forum-brightgreen.svg)](https://community.openmqttgateway.com) -[![Build Status](https://travis-ci.com/1technophile/OpenMQTTGateway.svg?branch=master)](https://travis-ci.com/1technophile/OpenMQTTGateway) +[![Build Status](https://github.com/1technophile/OpenMQTTGateway/workflows/Build/badge.svg?branch=master)](https://github.com/1technophile/OpenMQTTGateway/actions) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/943c9b639b68441dae8e29ee39977ab2)](https://www.codacy.com/app/1technophile/OpenMQTTGateway?utm_source=github.com&utm_medium=referral&utm_content=1technophile/OpenMQTTGateway&utm_campaign=badger) [![Percentage of issues still open](http://isitmaintained.com/badge/open/1technophile/openmqttgateway.svg)](http://isitmaintained.com/project/1technophile/openmqttgateway "Percentage of issues still open") [![GitLicense](https://gitlicense.com/badge/1technophile/OpenMQTTGateway)](https://gitlicense.com/license/1technophile/OpenMQTTGateway) diff --git a/docs/participate/development.md b/docs/participate/development.md index 775ca39..7e182a7 100644 --- a/docs/participate/development.md +++ b/docs/participate/development.md @@ -3,7 +3,7 @@ I like pull requests from everyone. By participating in this project, you agree to follow the code of conduct below -[code of conduct]: https://github.com/1technophile/OpenMQTTGateway/blob/master/CODE_OF_CONDUCT.md +[code of conduct](https://github.com/1technophile/OpenMQTTGateway/blob/master/CODE_OF_CONDUCT.md) [code style guide](https://google.github.io/styleguide/cppguide.html#Formatting) @@ -16,7 +16,7 @@ Make your modification, Review your code, compile it for Arduino Uno and ESP8266 -Test it localy on your hardware config +Test it locally on your hardware config If you modify `User_config.h` during your developments you need to report your modifications into Test_config.h https://github.com/1technophile/OpenMQTTGateway/blob/master/tests/Test_config.h @@ -25,7 +25,7 @@ Indeed during the continuous integration process `User_config.h` is replaced by Emit a pull request -Verify the travis CI compilation results +Verify the GitHub Actions CI compilation results Request for review diff --git a/docs/upload/troubleshoot.md b/docs/upload/troubleshoot.md index f78a155..4440cb6 100644 --- a/docs/upload/troubleshoot.md +++ b/docs/upload/troubleshoot.md @@ -1,8 +1,10 @@ # Troubleshooting ## Compilation/build error -This badge [![Build Status](https://travis-ci.com/1technophile/OpenMQTTGateway.svg?branch=master)](https://travis-ci.com/1technophile/OpenMQTTGateway) show you the state of the compilation of the master and this one [![Build Status](https://travis-ci.com/1technophile/OpenMQTTGateway.svg?branch=development)](https://travis-ci.com/1technophile/OpenMQTTGateway) for the development branch. If you see a green badge this means that the code compilation is OK with the configuration given in the docs/platformio.ini. Check your IDE environment version, boards version, libraries version before submitting an issue or a question. -Verify especially that the libraries provided into the [the release page](https://github.com/1technophile/OpenMQTTGateway/releases) are located into your "sketchbook folder"/libraries if your are using the Arduino IDE. +This badge [![Build Status](https://github.com/1technophile/OpenMQTTGateway/workflows/Build/badge.svg?branch=master)](https://github.com/1technophile/OpenMQTTGateway/actions?query=branch%3Amaster+workflow%3ABuild) show you the state of the compilation of the master and this one [![Build Status](https://github.com/1technophile/OpenMQTTGateway/workflows/Build/badge.svg?branch=development)](https://github.com/1technophile/OpenMQTTGateway/actions?query=branch%3Adevelopment+workflow%3ABuild) for the development branch. +If you see a green badge this means that the code compilation is OK with the configuration given in the `docs/platformio.ini`. +Check your IDE environment version, boards version, libraries version before submitting an issue or a question. +Verify especially that the libraries provided into the [release page](https://github.com/1technophile/OpenMQTTGateway/releases) are located into your "sketchbook folder"/libraries if your are using the Arduino IDE. ## ESP32 compilation errors related to wifi If you get one or several of the following errors: @@ -29,10 +31,10 @@ Regarding the IR led emitter you can replace it with a normal led and see if it try with D2 instead of D3 and put -define RF_RECEIVER_PIN 4 // D2 on nodemcu +`#define RF_RECEIVER_PIN 4 // D2 on nodemcu` in config_rf.h instead of -define RF_RECEIVER_PIN 0 // D3 on nodemcu +`#define RF_RECEIVER_PIN 0 // D3 on nodemcu` ## Exception seen on serial monitor: Hey I got a callback diff --git a/scripts/prepare_deploy.sh b/scripts/prepare_deploy.sh old mode 100644 new mode 100755 index 3f01b6f..3787517 --- a/scripts/prepare_deploy.sh +++ b/scripts/prepare_deploy.sh @@ -1,19 +1,22 @@ +#!/bin/bash +set -e echo "renaming bin files with the board name" rename -v 's:/:-:g' .pio/build/*/*.bin mkdir toDeploy rename 's/.pio-build-//' .*.bin -cd .pio/libdeps -echo "replace space by _ in folder names" -find . -type d -name "* *" | while read FNAME; do mv "$FNAME" "${FNAME// /_}"; done -echo "zipping libraries per board" -for i in */; do zip -r "${i%/}-libraries.zip" "$i"; done -ls -la -mv *.zip ../../toDeploy -cd ../.. +( + cd .pio/libdeps + echo "replace space by _ in folder names" + find . -type d -name "* *" | while read FNAME; do mv "$FNAME" "${FNAME// /_}"; done + echo "zipping libraries per board" + for i in */; do zip -r "${i%/}-libraries.zip" "$i"; done + ls -la + mv *.zip ../../toDeploy +) + echo "zipping code and licence" zip -r OpenMQTTGateway_sources.zip main LICENSE.txt mv *.zip toDeploy mv *.bin toDeploy -cd toDeploy -ls -la -cd .. + +ls -lA toDeploy