From 9408bbb297eb75ee0b1c96e7af32c9061fb51441 Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Wed, 23 Sep 2020 22:28:53 +0200 Subject: [PATCH 1/7] add GitHub workflow to build thermometer firmware --- .github/workflows/build_thermometer.yml | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/build_thermometer.yml diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml new file mode 100644 index 00000000..1e4d0445 --- /dev/null +++ b/.github/workflows/build_thermometer.yml @@ -0,0 +1,56 @@ +name: Build ATC_Thermometer + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + container: skaldo/telink-sdk:0.1 + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build ATC_Thermometer + run: | + cd ATC_Thermometer + make + cd $GITHUB_WORKSPACE + ls -la + - name: Build thermometer + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.sha }} + release_name: Release ${{ github.sha }} + draft: false + prerelease: true + - name: upload ATC_Thermometer.bin to releases + id: upload-atc-thermometer-binary + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ATC_Thermometer.bin + asset_name: ATC_Thermometer.bin + asset_content_type: application/octet-stream + - name: zip output directory + uses: montudor/action-zip@v0.1.0 + with: + args: zip -qq -r output.zip out + - name: upload output directory to releases + id: upload-output-folder + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./output.zip + asset_name: output.zip + asset_content_type: application/zip From 7a139216230cc10650fff9437a4872044ba99a5f Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Wed, 23 Sep 2020 22:30:03 +0200 Subject: [PATCH 2/7] adjust telink SDK path --- ATC_Thermometer/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ATC_Thermometer/makefile b/ATC_Thermometer/makefile index 92a8abb3..8a616246 100644 --- a/ATC_Thermometer/makefile +++ b/ATC_Thermometer/makefile @@ -2,7 +2,7 @@ TEL_CHIP := -DCHIP_TYPE=CHIP_TYPE_8258 LIBS := -llt_8258 -TEL_PATH := ../.. +TEL_PATH := /opt/Telink_825X_SDK PROJECT_NAME := ATC_Thermometer From 2b2d6069ea7a3851ae6ca58b9aca1ab4059e61b7 Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Wed, 23 Sep 2020 22:34:03 +0200 Subject: [PATCH 3/7] release name is now run_number --- .github/workflows/build_thermometer.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml index 1e4d0445..74999d75 100644 --- a/.github/workflows/build_thermometer.yml +++ b/.github/workflows/build_thermometer.yml @@ -20,14 +20,14 @@ jobs: make cd $GITHUB_WORKSPACE ls -la - - name: Build thermometer + - name: Create GitHub release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.sha }} - release_name: Release ${{ github.sha }} + tag_name: ${{ github.run_number }} + release_name: Release ${{ github.run_number }} draft: false prerelease: true - name: upload ATC_Thermometer.bin to releases From fcdab880c981c4aff22dab47677259a448f96fa5 Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Wed, 23 Sep 2020 22:35:35 +0200 Subject: [PATCH 4/7] do not zip output directory for now --- .github/workflows/build_thermometer.yml | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml index 74999d75..7ea53f2a 100644 --- a/.github/workflows/build_thermometer.yml +++ b/.github/workflows/build_thermometer.yml @@ -40,17 +40,17 @@ jobs: asset_path: ./ATC_Thermometer.bin asset_name: ATC_Thermometer.bin asset_content_type: application/octet-stream - - name: zip output directory - uses: montudor/action-zip@v0.1.0 - with: - args: zip -qq -r output.zip out - - name: upload output directory to releases - id: upload-output-folder - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./output.zip - asset_name: output.zip - asset_content_type: application/zip + # - name: zip output directory + # uses: montudor/action-zip@v0.1.0 + # with: + # args: zip -qq -r output.zip out + # - name: upload output directory to releases + # id: upload-output-folder + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./output.zip + # asset_name: output.zip + # asset_content_type: application/zip From 173bbed9d4d6feda07cafeb760af0bb66b5a6038 Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Mon, 30 Nov 2020 21:54:42 +0100 Subject: [PATCH 5/7] use GitHub image registry --- .github/workflows/build_thermometer.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml index 7ea53f2a..7ddf9ac0 100644 --- a/.github/workflows/build_thermometer.yml +++ b/.github/workflows/build_thermometer.yml @@ -9,12 +9,14 @@ on: jobs: build: runs-on: ubuntu-latest - container: skaldo/telink-sdk:0.1 + container: docker.pkg.github.com/skaldo/telink-sdk/telink-sdk:latest steps: - name: Checkout uses: actions/checkout@v2 - name: Build ATC_Thermometer + env: + TEL_PATH: /opt/Telink_825X_SDK run: | cd ATC_Thermometer make From 92b3f9b2db0ea5a501f9cced0ea51084058a4437 Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Mon, 30 Nov 2020 22:06:47 +0100 Subject: [PATCH 6/7] authenticate against GitHub image registry --- .github/workflows/build_thermometer.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml index 7ddf9ac0..6c631a73 100644 --- a/.github/workflows/build_thermometer.yml +++ b/.github/workflows/build_thermometer.yml @@ -9,7 +9,11 @@ on: jobs: build: runs-on: ubuntu-latest - container: docker.pkg.github.com/skaldo/telink-sdk/telink-sdk:latest + container: + image: docker.pkg.github.com/skaldo/telink-sdk/telink-sdk:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout From 0791daba9c34733eeb63a06ce8d6649278c226fe Mon Sep 17 00:00:00 2001 From: Dominik Skalnik Date: Mon, 30 Nov 2020 22:12:33 +0100 Subject: [PATCH 7/7] remove commented step --- .github/workflows/build_thermometer.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/build_thermometer.yml b/.github/workflows/build_thermometer.yml index 6c631a73..8b13775f 100644 --- a/.github/workflows/build_thermometer.yml +++ b/.github/workflows/build_thermometer.yml @@ -46,17 +46,3 @@ jobs: asset_path: ./ATC_Thermometer.bin asset_name: ATC_Thermometer.bin asset_content_type: application/octet-stream - # - name: zip output directory - # uses: montudor/action-zip@v0.1.0 - # with: - # args: zip -qq -r output.zip out - # - name: upload output directory to releases - # id: upload-output-folder - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ steps.create_release.outputs.upload_url }} - # asset_path: ./output.zip - # asset_name: output.zip - # asset_content_type: application/zip