Skip to content

Commit 41a8877

Browse files
committed
Use actions repo
1 parent 5fb3c3b commit 41a8877

File tree

22 files changed

+944
-27
lines changed

22 files changed

+944
-27
lines changed

.github/actions/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# GitHub Reusable Actions for openDAQ Framework
2+
3+
This directory contains **reusable GitHub Actions** used to work with the **openDAQ framework**.
4+
The actions support determining the latest or specific release, downloading it from S3, and installing it on Linux or Windows runners.
5+
6+
---
7+
8+
## Actions Overview
9+
10+
| Action | Description | Inputs | Outputs |
11+
|--------|-------------|--------|---------|
12+
| [framework-latest-release](./framework-latest-release/README.md) | Determines which openDAQ framework package to use (latest release or specific version). | `opendaq-framework-release-version`, `win32-force` | `version`, `platform`, `packaging`, `artefact`, `uri`, `scheme`, `authority`, `path` |
13+
| [framework-download](./framework-download/README.md) | Downloads the resolved openDAQ framework package from AWS S3. | `src-opendaq-framework-dev`, `dst-opendaq-framework-dev`, `aws_access_key_id`, `aws_secret_access_key`, `aws_region` | None |
14+
| [framework-install](./framework-install/README.md) | Installs the downloaded openDAQ framework package on the runner. | `opendaq-framework-package-filename`, `opendaq-framework-package-path` | None |
15+
16+
---
17+
18+
## Recommended Usage
19+
20+
A typical workflow combining all three actions:
21+
22+
```yaml
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Resolve openDAQ framework version
31+
id: framework
32+
uses: ./.github/actions/framework-latest-release
33+
with:
34+
opendaq-framework-release-version: latest
35+
36+
- name: Download openDAQ framework
37+
uses: ./.github/actions/framework-download
38+
with:
39+
src-opendaq-framework-dev: ${{ steps.framework.outputs.uri }}
40+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
41+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
42+
aws_region: ${{ secrets.AWS_REGION }}
43+
44+
- name: Install openDAQ framework
45+
uses: ./.github/actions/framework-install
46+
with:
47+
opendaq-framework-package-filename: ${{ steps.framework.outputs.artefact }}
48+
```
49+
50+
## Notes
51+
52+
- Linux and Windows runners are supported.
53+
- framework-latest-release requires GitHub CLI (gh) and jq.
54+
- framework-download requires AWS CLI.
55+
- framework-install installs differently depending on OS.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# framework-download
2+
3+
This composite action downloads an **openDAQ framework package** from **AWS S3** to the runner.
4+
It supports both Linux/macOS and Windows runners.
5+
6+
---
7+
8+
## Inputs
9+
10+
| Name | Required | Default | Description |
11+
|-----------------------------|----------|---------------------|-------------|
12+
| `src-opendaq-framework-dev` | yes || Full S3 URI to the package (e.g. `s3://bucket/releases/v3.20.4/SDK/opendaq-3.20.4-win64.exe`). |
13+
| `dst-opendaq-framework-dev` | no | `${{ runner.temp }}`| Destination path for the downloaded package on the runner. |
14+
| `aws_access_key_id` | yes || AWS Access Key ID used for authentication. |
15+
| `aws_secret_access_key` | yes || AWS Secret Access Key used for authentication. |
16+
| `aws_region` | yes || AWS Region where the bucket is located. |
17+
18+
---
19+
20+
## Example usage
21+
22+
```yaml
23+
jobs:
24+
download:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Download openDAQ framework
31+
uses: ./.github/actions/framework-download
32+
with:
33+
src-opendaq-framework-dev: "s3://bb-blueberry-sdk-releases/releases/v3.20.4/SDK/opendaq-3.20.4-ubuntu22.04-x86_64.deb"
34+
dst-opendaq-framework-dev: "/tmp/opendaq-3.20.4-ubuntu22.04-x86_64.deb"
35+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
36+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37+
aws_region: ${{ secrets.AWS_REGION }}
38+
```
39+
40+
## Notes
41+
- Uses aws-actions/configure-aws-credentials to set up credentials.
42+
- Downloads via aws s3 cp, which must be available in the runner environment.
43+
- On GitHub-hosted runners, the AWS CLI is pre-installed.
44+
- Supports Linux/macOS (bash) and Windows (pwsh) runners.
45+
- Destination path must be writable by the runner.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Download openDAQ framework package
2+
description: "Download a package from S3 for Linux or Windows"
3+
4+
inputs:
5+
src-opendaq-framework-dev:
6+
required: true
7+
description: "S3 path to the package"
8+
dst-opendaq-framework-dev:
9+
required: false
10+
default: ${{ runner.temp }}
11+
description: "Destination path for downloaded package"
12+
13+
aws_access_key_id:
14+
required: true
15+
description: "AWS Access Key ID"
16+
aws_secret_access_key:
17+
required: true
18+
description: "AWS Secret Access Key"
19+
aws_region:
20+
required: true
21+
description: "AWS Region"
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Configure AWS
27+
uses: aws-actions/configure-aws-credentials@v4
28+
with:
29+
aws-access-key-id: ${{ inputs.aws_access_key_id }}
30+
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
31+
aws-region: ${{ inputs.aws_region }}
32+
33+
- name: Download package from S3 (Linux/macOS)
34+
if: runner.os != 'Windows'
35+
shell: bash
36+
run: |
37+
set -e
38+
DST="${{ inputs.dst-opendaq-framework-dev }}"
39+
SRC="${{ inputs.src-opendaq-framework-dev }}"
40+
echo "Downloading $SRC to $DST"
41+
aws s3 cp "$SRC" "$DST"
42+
43+
- name: Download package from S3 (Windows)
44+
if: runner.os == 'Windows'
45+
shell: pwsh
46+
run: |
47+
$dst = "${{ inputs.dst-opendaq-framework-dev }}"
48+
$src = "${{ inputs.src-opendaq-framework-dev }}"
49+
Write-Host "Downloading $src to $dst"
50+
aws s3 cp "$src" "$dst"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# framework-install
2+
3+
This composite action installs an **openDAQ framework package** on the runner.
4+
It supports **Windows (installer executable)** and **Linux (Debian package)**.
5+
Other operating systems are not supported.
6+
7+
---
8+
9+
## Inputs
10+
11+
| Name | Required | Default | Description |
12+
|-----------------------------------|----------|---------------------|-------------|
13+
| `opendaq-framework-package-filename` | yes || Name of the package file (e.g. `opendaq-3.20.4-win64.exe`, `opendaq-3.20.4-ubuntu22.04-x86_64.deb`). |
14+
| `opendaq-framework-package-path` | no | `${{ runner.temp }}`| Directory where the package file is located. |
15+
16+
---
17+
18+
## Example usage
19+
20+
```yaml
21+
jobs:
22+
install:
23+
runs-on: windows-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install openDAQ framework
29+
uses: ./.github/actions/framework-install
30+
with:
31+
opendaq-framework-package-filename: "opendaq-3.20.4-win64.exe"
32+
opendaq-framework-package-path: "C:\\actions\\temp"
33+
```
34+
```yml
35+
jobs:
36+
install:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Install openDAQ framework
43+
uses: ./.github/actions/framework-install
44+
with:
45+
opendaq-framework-package-filename: "opendaq-3.20.4-ubuntu22.04-x86_64.deb"
46+
opendaq-framework-package-path: "/tmp"
47+
```
48+
49+
## Notes
50+
- Windows:
51+
- Runs the installer in silent mode (/S).
52+
- After installation, updates the PATH environment variable to include:
53+
```powershell
54+
PATH=C:\Program Files\openDAQ\bin;$PATH
55+
```
56+
- Linux:
57+
- Installs the package via dpkg -i.
58+
- Requires sudo access on the runner.
59+
- Unsupported OS:
60+
- The action exits with an error for macOS or other platforms.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Install openDAQ framework package
2+
3+
inputs:
4+
opendaq-framework-package-filename:
5+
required: true
6+
7+
opendaq-framework-package-path:
8+
required: false
9+
default: ${{ runner.temp }}
10+
11+
runs:
12+
using: composite
13+
14+
steps:
15+
- name: Install openDAQ framework package (Windows)
16+
if: runner.os == 'Windows'
17+
shell: pwsh
18+
run: |
19+
$packagePath = Join-Path "${{ inputs.opendaq-framework-package-path }}" "${{ inputs.opendaq-framework-package-filename }}"
20+
$process = Start-Process -FilePath $packagePath -ArgumentList "/S" -Wait -NoNewWindow -PassThru
21+
if ($process.ExitCode -eq 0) {
22+
Write-Host "OpenDAQ installed successfully, updating PATH..."
23+
$openDAQBin = "C:\Program Files\openDAQ\bin"
24+
Add-Content -Path $env:GITHUB_ENV -Value "PATH=$openDAQBin`;$env:PATH"
25+
Write-Host $env:PATH
26+
}
27+
else {
28+
Write-Host "OpenDAQ installation failed with exit code $($process.ExitCode)"
29+
exit $process.ExitCode
30+
}
31+
32+
- name: Install openDAQ framework package (Linux)
33+
if: runner.os == 'Linux'
34+
shell: bash
35+
run: sudo dpkg -i "${{ inputs.opendaq-framework-package-path }}/${{ inputs.opendaq-framework-package-filename }}"
36+
37+
- name: Unsupported runner OS
38+
if: runner.os != 'Windows' && runner.os != 'Linux'
39+
shell: bash
40+
run: |
41+
echo "Install openDAQ is not supported for ${{ runner.os }}"
42+
exit 1
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# framework-latest-release
2+
3+
This composite action determines the **openDAQ framework package** to use.
4+
It supports resolving either the **latest release** from GitHub or a **specific version** provided as input,
5+
and outputs all required information to download and install the package.
6+
7+
---
8+
9+
## Inputs
10+
11+
| Name | Required | Default | Description |
12+
|-------------------------------------|----------|---------|-------------|
13+
| `opendaq-framework-release-version` | no | `latest`| openDAQ framework version. Use `latest` for the newest release, or provide a specific version (e.g. `3.20.4`). |
14+
| `win32-force` | no | `false` | On Windows runners, forces `win32` instead of `win64` platform. |
15+
16+
---
17+
18+
## Outputs
19+
20+
| Name | Description |
21+
|------------|-------------|
22+
| `version` | Resolved openDAQ release version (e.g. `3.20.4`). |
23+
| `platform` | Detected platform string (`ubuntu22.04-x86_64`, `ubuntu22.04-arm64`, `win32`, `win64`). |
24+
| `packaging`| Package type (`deb` on Linux, `exe` on Windows). |
25+
| `artefact` | Resolved artefact filename (e.g. `opendaq-3.20.4-win64.exe`). |
26+
| `scheme` | URI scheme (currently `s3`). |
27+
| `authority`| Storage authority (S3 bucket name). |
28+
| `path` | Path inside the bucket (e.g. `releases/v3.20.4/SDK`). |
29+
| `uri` | Full URI to the artefact (e.g. `s3://bucket/releases/v3.20.4/SDK/opendaq-3.20.4-win64.exe`). |
30+
31+
---
32+
33+
## Example usage
34+
35+
```yaml
36+
jobs:
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
43+
- name: Determine openDAQ framework package
44+
id: framework
45+
uses: ./.github/actions/framework-latest-release
46+
with:
47+
opendaq-framework-release-version: latest
48+
49+
- name: Print resolved artefact info
50+
run: |
51+
echo "Version: ${{ steps.framework.outputs.version }}"
52+
echo "Platform: ${{ steps.framework.outputs.platform }}"
53+
echo "Artefact: ${{ steps.framework.outputs.artefact }}"
54+
echo "URI: ${{ steps.framework.outputs.uri }}"
55+
```
56+
57+
## Notes
58+
- The action relies on GitHub CLI (gh) and jq.
59+
- These are pre-installed on GitHub-hosted Ubuntu and Windows runners.
60+
- On Windows, if you explicitly need a 32-bit package, set win32-force: true.
61+
- If the latest release cannot be determined, the action fails.

0 commit comments

Comments
 (0)