diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..f9cff525 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,89 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference +version: 2.1 + + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/configuration-reference/#jobs +jobs: + build: + # Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub. + # + # See: https://circleci.com/docs/configuration-reference/#executor-job + # + # See: https://circleci.com/docs/parallelism-faster-jobs/ + # + docker: + - image: cimg/base:stable + # Add steps to the job + # See: https://circleci.com/docs/configuration-reference/#steps + steps: + - checkout + - run: + name: "Step.1 Build LoRA Gateway" + command: | + echo "start to build Lora Gateway" + make all + - run: + name: "Step.2 Copy LoRA Gwlib to Output" + command: | + echo "Copy Lora GWlib to Output" + mkdir -p output + cp -a libloragw/libloragw.a ./output/ + cp -a util_pkt_logger/util_pkt_logger ./output/ + cp -a util_spi_stress/util_spi_stress ./output/ + cp -a util_tx_test/util_tx_test ./output/ + cp -a util_lbt_test/util_lbt_test ./output/ + cp -a util_tx_continuous/util_tx_continuous ./output/ + cp -a util_spectral_scan/util_spectral_scan ./output/ + cp -a ./output ./artifacts + mkdir -p /tmp/112233/output + cp -a ./output /tmp/112233/output + FILE_LIST=`ls ./artifacts/` + echo "FILE: $FILE_LIST " + + - store_artifacts: + path: ./artifacts + + - persist_to_workspace: + root: /tmp/112233 + paths: + - output + +# +# https://circleci.com/blog/publishing-to-github-releases-via-circleci/ +# +# ** GITHUB_TOKEN ** have to Setup Github +# https://docs.github.com/ko/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens +# + publish-github-release: + docker: + - image: cibuilds/github:0.10 + steps: + - attach_workspace: + at: ./artifacts + - run: + name: "Publish Release on GitHub" + command: | + echo " STEP.1 Start Deploying to Github" + echo " STEP.2 Check working: Meta 1:${GITHUB_TOKEN} 2:${CIRCLE_PROJECT_USERNAME} 3:${CIRCLE_PROJECT_REPONAME} 4:${CIRCLE_SHA1} " + VERSION=5.1 + GITHUB_TOKEN="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" + echo " STEP.3 Check working: Version ${VERSION} " + ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/ + echo " STEP.4 WORKING OK " + + + +# Orchestrate jobs using workflows +# See: https://circleci.com/docs/configuration-reference/#workflows +workflows: + build-deploy: + jobs: + - build +# - publish-github-release: +# requires: +# - build +# filters: +# branches: +# only: circleci-project-setup diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml new file mode 100644 index 00000000..f3016f48 --- /dev/null +++ b/.github/workflows/ccpp.yml @@ -0,0 +1,95 @@ +name: LoRa Gateway C/C++ CI in circleci-preject-setup + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest +# +# Steps +# + steps: +# +# > STEP.1 Checkout +# Help +# - https://github.com/actions/checkout +# + - name: Checkout Repository + uses: actions/checkout@v3 + +# +# > STEP.2 Build and Make Output +# Help +# - https://github.com/actions/checkout +# + + - name: Build Lora Gateway + run: | + pwd + echo "Start to build Lora Gateway" + make all + mkdir -p output + cp -a libloragw/libloragw.a ./output/ + cp -a libloragw/library.cfg ./output/ + cp -a util_pkt_logger/util_pkt_logger ./output/ + cp -a util_spi_stress/util_spi_stress ./output/ + cp -a util_tx_test/util_tx_test ./output/ + cp -a util_lbt_test/util_lbt_test ./output/ + cp -a util_tx_continuous/util_tx_continuous ./output/ + cp -a util_spectral_scan/util_spectral_scan ./output/ + zip --junk-paths -r loragatway output + +# +# > STEP.3 Upload Output to Artifact +# Help +# - https://github.com/actions/upload-artifact +# + - name: Upload a Build Artifact + uses: actions/upload-artifact@v3.0.0 + with: + # Artifact name + name: LoRaLib + path: | + ./output + retention-days: 90 + + +# +# > STEP.4 Create Release in Github +# Help +# https://github.com/actions/create-release +# + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v5.2.4.7 + release_name: v5.2.4.7 + body: | + Changes in this Release + - First Change + - Second Change + draft: false + +# +# > STEP.5 Upload an added file to Release in Github +# Help +# - https://github.com/actions/upload-release-asset +# + - name: Add Release asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./loragatway.zip + asset_name: loragatway.zip + asset_content_type: application/zip + + + + diff --git a/readme.md b/readme.md index 001cfa0a..922dcd45 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,23 @@ - / _____) _ | | +Github +==== +![GitHub release](https://img.shields.io/github/release/JeonghunLee/lora_gateway.svg?style=flat-square) +![GitHub Action](https://github.com/JeonghunLee/lora_gateway/actions/workflows/ccpp.yml/badge.svg) +![example workflow](https://github.com/JeonghunLee/lora_gateway/actions/workflows/ccpp.yml/badge.svg) +![example event parameter](https://github.com/JeonghunLee/lora_gateway/actions/workflows/ccpp.yml/badge.svg?event=push) +![example branch parameter](https://github.com/JeonghunLee/lora_gateway/actions/workflows/ccpp.yml/badge.svg?branch=circleci-project-setup) + + + +Circle CI +==== +[![CircleCI Build Status](https://circleci.com/gh/JeonghunLee/lora_gateway.svg?style=shield)](https://circleci.com/gh/JeonghunLee/lora_gateway) + +[![CircleCI](https://dl.circleci.com/insights-snapshot/gh/JeonghunLee/lora_gateway/workflows/build-deploy/badge.svg?window=30d)](https://app.circleci.com/insights/github/JeonghunLee/lora_gateway/workflows/build-deploy/overview?branch=circleci-project-setup&reporting-window=last-30-days&insights-snapshot=true) + + +# LoRa Gateway + + / _____) _ | | ( (____ _____ ____ _| |_ _____ ____| |__ \____ \| ___ | (_ _) ___ |/ ___) _ \ _____) ) ____| | | || |_| ____( (___| | | |