From 5ec994be8bcbfc2b294c19bf387368cec4bc3c70 Mon Sep 17 00:00:00 2001 From: JM Date: Sun, 6 Oct 2024 21:29:07 +0100 Subject: [PATCH 01/10] Updated version. --- src/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version.h b/src/version.h index bfe764f..0461671 100644 --- a/src/version.h +++ b/src/version.h @@ -14,10 +14,10 @@ namespace mtspin { inline constexpr char* kName = "mtspin-mcu-firmware-"; -inline constexpr uint16_t kMajor = 0; -inline constexpr uint16_t kMinor = 1; +inline constexpr uint16_t kMajor = 1; +inline constexpr uint16_t kMinor = 0; inline constexpr uint16_t kPatch = 0; -inline constexpr char* kSuffix = " "; +inline constexpr char* kSuffix = "-rc.1"; } // namespace mtspin From acfbb4e96766da0abb302a28743db8e2170764c6 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 05:49:36 +0100 Subject: [PATCH 02/10] Updated README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3e37dc..4323858 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ The following libraries (available via the [Arduino library manager](https://www The image below shows a high level overview of the system: -![UML class diagram](docs\uml-class-diagram-overview.png) +![UML class diagram](docs/uml-class-diagram-overview.png) ## Setup and build @@ -165,7 +165,7 @@ For Linux: ## System control and logging/status reporting -The project provides a means of controlling the system, and interrogating the status of the system via serial messages once the programme is uploaded to the Arduino board. The following messages are implemented: +The project provides a means of controlling the system and interrogating the status of the system via serial messages once, the programme is uploaded to the Arduino board. The following messages are implemented: |Message|Action| |:----:|----| From 89a204b07348eb0e3811b2d20c576003852dcc17 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 08:21:24 +0100 Subject: [PATCH 03/10] Updated CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index 9e8ba65..e33e016 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -26,5 +26,5 @@ jobs: with: name: binaries path: | - ${{ env.BUILD_DIR }}/*.bin + ${{ github.workspace }}/${{ env.BUILD_DIR }}/*.bin retention-days: 7 \ No newline at end of file From e38849ea6737d0912110b5fa254aec75a6ae1d52 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 08:25:34 +0100 Subject: [PATCH 04/10] Debugging CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index e33e016..f46f103 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -21,10 +21,13 @@ jobs: sudo bash -x scripts/setup-build-linux.sh -deps - name: Build/compile the project run: sudo bash -x scripts/setup-build-linux.sh -build - - name: Upload compiled binaries - uses: actions/upload-artifact@v4 - with: - name: binaries - path: | - ${{ github.workspace }}/${{ env.BUILD_DIR }}/*.bin - retention-days: 7 \ No newline at end of file + - name: List files in workspace + run: | + ls ${{ github.workspace }} + #- name: Upload compiled binaries + # uses: actions/upload-artifact@v4 + # with: + # name: binaries + # path: | + # ${{ github.workspace }}/${{ env.BUILD_DIR }}/*.bin + # retention-days: 7 \ No newline at end of file From 4182447bda047bb3d34186d85288948f9fdd8c80 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 08:31:06 +0100 Subject: [PATCH 05/10] Debugging CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index f46f103..5230a8f 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -23,7 +23,7 @@ jobs: run: sudo bash -x scripts/setup-build-linux.sh -build - name: List files in workspace run: | - ls ${{ github.workspace }} + ls ${{ github.workspace }}/${{ env.BUILD_DIR }} #- name: Upload compiled binaries # uses: actions/upload-artifact@v4 # with: From c7458413959bd897c5bd93228b1d9c268115ff66 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 20:18:46 +0100 Subject: [PATCH 06/10] Debugging CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index 5230a8f..75def1c 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -10,6 +10,7 @@ jobs: env: # Environment variables BUILD_DIR: build + SKETCH_NAME: src steps: - name: Checkout repository @@ -21,13 +22,10 @@ jobs: sudo bash -x scripts/setup-build-linux.sh -deps - name: Build/compile the project run: sudo bash -x scripts/setup-build-linux.sh -build - - name: List files in workspace - run: | - ls ${{ github.workspace }}/${{ env.BUILD_DIR }} - #- name: Upload compiled binaries - # uses: actions/upload-artifact@v4 - # with: - # name: binaries - # path: | - # ${{ github.workspace }}/${{ env.BUILD_DIR }}/*.bin - # retention-days: 7 \ No newline at end of file + - name: Upload compiled binaries + uses: actions/upload-artifact@v4 + with: + name: binaries + path: | + ${{ github.workspace }}/${{ env.BUILD_DIR }}/**/${{ env.SKETCH_NAME }}* + retention-days: 7 \ No newline at end of file From a17650f2818244b990a3e6837e54cd373cd2a609 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 20:53:31 +0100 Subject: [PATCH 07/10] Debugging CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index 75def1c..4030411 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -27,5 +27,5 @@ jobs: with: name: binaries path: | - ${{ github.workspace }}/${{ env.BUILD_DIR }}/**/${{ env.SKETCH_NAME }}* + ${{ github.workspace }}/${{ env.BUILD_DIR }}/*/${{ env.SKETCH_NAME }}* retention-days: 7 \ No newline at end of file From f8791ad93ba27a0d3895156373e3565ae6d2a492 Mon Sep 17 00:00:00 2001 From: JM Date: Mon, 7 Oct 2024 22:30:45 +0100 Subject: [PATCH 08/10] Debugging CI/CD workflow. --- .github/workflows/build-project.yaml | 2 +- .github/workflows/generate-binaries.yaml | 6 ++++-- .github/workflows/release-binaries.yaml | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release-binaries.yaml diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 125a9c7..8aca528 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -7,7 +7,7 @@ on: types: [opened, synchronize, reopened] jobs: - static-check: + build-project: name: Build project runs-on: ubuntu-latest diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index 4030411..54bb4c1 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -1,9 +1,10 @@ name: Generate binaries on: workflow_dispatch: + workflow_call: jobs: - build: + generate-binaries: name: Generate binaries runs-on: ubuntu-latest @@ -11,6 +12,7 @@ jobs: # Environment variables BUILD_DIR: build SKETCH_NAME: src + ARTIFACT_NAME: binaries steps: - name: Checkout repository @@ -25,7 +27,7 @@ jobs: - name: Upload compiled binaries uses: actions/upload-artifact@v4 with: - name: binaries + name: ${{ env.ARTIFACT_NAME }} path: | ${{ github.workspace }}/${{ env.BUILD_DIR }}/*/${{ env.SKETCH_NAME }}* retention-days: 7 \ No newline at end of file diff --git a/.github/workflows/release-binaries.yaml b/.github/workflows/release-binaries.yaml new file mode 100644 index 0000000..3d58d61 --- /dev/null +++ b/.github/workflows/release-binaries.yaml @@ -0,0 +1,14 @@ +name: Release binaries +on: + release: + types: [published] + +jobs: + call-workflow-to-generate-binaries: + name: Call workflow to generate binaries + uses: ./.github/workflows/generate-binaries.yaml + + release-binaries: + name: Release binaries + runs-on: ubuntu-latest + From c4d2c4e7299bfb536348ba66cd11990de3e9cc2f Mon Sep 17 00:00:00 2001 From: JM Date: Tue, 8 Oct 2024 22:13:39 +0100 Subject: [PATCH 09/10] Debugging CI/CD workflow. --- .github/workflows/generate-binaries.yaml | 2 -- .github/workflows/release-binaries.yaml | 35 ++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-binaries.yaml b/.github/workflows/generate-binaries.yaml index 54bb4c1..20ed3bb 100644 --- a/.github/workflows/generate-binaries.yaml +++ b/.github/workflows/generate-binaries.yaml @@ -7,13 +7,11 @@ jobs: generate-binaries: name: Generate binaries runs-on: ubuntu-latest - env: # Environment variables BUILD_DIR: build SKETCH_NAME: src ARTIFACT_NAME: binaries - steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/release-binaries.yaml b/.github/workflows/release-binaries.yaml index 3d58d61..29c1593 100644 --- a/.github/workflows/release-binaries.yaml +++ b/.github/workflows/release-binaries.yaml @@ -2,13 +2,44 @@ name: Release binaries on: release: types: [published] + workflow_dispatch: jobs: - call-workflow-to-generate-binaries: + generate-binaries: name: Call workflow to generate binaries uses: ./.github/workflows/generate-binaries.yaml release-binaries: name: Release binaries runs-on: ubuntu-latest - + env: + # Environment variables + ARTIFACT_NAME: binaries + needs: generate-binaries + steps: + - name: Download binaries + uses: actions/download-artifact@v4 + with: + name: ${{ env.ARTIFACT_NAME }} + - name: Verify artifact download (Debugging) + run: ls -R + - name: Archive binaries + uses: thedoctor0/zip-release@master + with: + filename: ${{ env.ARTIFACT_NAME }}.zip + - name: Verify artifact archive (Debugging) + run: ls -R + - name: Get release URL + id: get-release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# - name: Upload binaries as release assets +# uses: actions/upload-release-asset@v1.0.2 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ steps.get-release.outputs.upload_url }} +# asset_path: ./${{ env.ARTIFACT_NAME }}.zip +# asset_name: ./${{ env.ARTIFACT_NAME }}.zip +# asset_content_type: application/zip \ No newline at end of file From 97889d32e7cca04c78d204db49c849b0c5ff2b5b Mon Sep 17 00:00:00 2001 From: JM Date: Wed, 9 Oct 2024 06:26:59 +0100 Subject: [PATCH 10/10] Updated setup/build instructions. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4323858..153f272 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ You work without an IDE by making use of the provided setup/build scripts and/or ### Setup and build scripts for Windows +Open a Command Prompt (CMD) terminal, navigate to the project directory, and run the commands in the following sections. + **Setup a Windows device ready to build the project.** Install arduino-cli: @@ -94,6 +96,8 @@ Replace COM3 in the command with the desired serial port. ### Setup and build scripts for Linux +Open a terminal, navigate to the project directory, and run the commands in the following sections. + **Setup a Linux device ready to build the project.** In order for Arduino tools to access the ports (e.g., to upload the programme to a board), your username/log-in name must be added to the dialout group: @@ -154,7 +158,7 @@ If you did not add arduino-cli to your devices environment path, the full path m For windows: ``` shell -C:\Program Files\arduino-cli +"%ProgramFiles%\Arduino CLI\arduino-cli" ``` For Linux: