Skip to content

Commit

Permalink
Merge pull request #7 from Morgritech/release/v1rc1
Browse files Browse the repository at this point in the history
CI/CD workflow updates
  • Loading branch information
jo3-tech authored Oct 9, 2024
2 parents 51c9bd8 + 97889d3 commit 4d2aa40
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [opened, synchronize, reopened]

jobs:
static-check:
build-project:
name: Build project
runs-on: ubuntu-latest

Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/generate-binaries.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: Generate binaries
on:
workflow_dispatch:
workflow_call:

jobs:
build:
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
Expand All @@ -24,7 +25,7 @@ jobs:
- name: Upload compiled binaries
uses: actions/upload-artifact@v4
with:
name: binaries
name: ${{ env.ARTIFACT_NAME }}
path: |
${{ env.BUILD_DIR }}/*.bin
${{ github.workspace }}/${{ env.BUILD_DIR }}/*/${{ env.SKETCH_NAME }}*
retention-days: 7
45 changes: 45 additions & 0 deletions .github/workflows/release-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release binaries
on:
release:
types: [published]
workflow_dispatch:

jobs:
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
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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 <commands>
"%ProgramFiles%\Arduino CLI\arduino-cli" <commands>
```

For Linux:
Expand All @@ -165,7 +169,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|
|:----:|----|
Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4d2aa40

Please sign in to comment.