Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions .github/workflows/test-bash-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Test Bash Framework
on:
push:
branches: [main]
paths-ignore: [ 'docs/**', '**/*.md' ]
paths: [ 'scripts-demo/**', 'tests/shell/bash/**' ]
pull_request:
paths-ignore: [ 'docs/**', '**/*.md' ]
paths: [ 'scripts-demo/**', 'tests/shell/bash/**' ]
workflow_dispatch:

jobs:
Expand All @@ -21,14 +21,8 @@ jobs:
- os: ubuntu-latest
shell-name: bash
shell-cmd: bash
- os: ubuntu-latest
shell-name: zsh
shell-cmd: zsh

# macOS - bash and zsh
- os: macos-latest
shell-name: bash
shell-cmd: bash
# macOS - zsh
- os: macos-latest
shell-name: zsh
shell-cmd: zsh
Expand All @@ -42,13 +36,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install zsh (Ubuntu only)
if: matrix.os == 'ubuntu-latest' && matrix.shell-name == 'zsh'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y zsh

- name: Run demo tests (excluding intentional failures)
shell: bash
working-directory: tests/shell/bash
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test-bash-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Test Bash Scripts
on:
push:
branches: [main]
paths-ignore: [ 'docs/**', '**/*.md' ]
paths: [ 'scripts/**', 'tests/shell/bash/**' ]
pull_request:
paths-ignore: [ 'docs/**', '**/*.md' ]
paths: [ 'scripts/**', 'tests/shell/bash/**' ]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -34,7 +34,8 @@ jobs:
working-directory: tests/shell/bash
run: |
./test-runner.sh \
--fail-fast true
--fail-fast true \
--verbose

- name: Test results summary
if: always()
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/test-framework-compose-filename-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Call action manually: framework compose filename"

on:
workflow_dispatch:
inputs:
runner:
description: "Runner to use (e.g. ubuntu-latest, ubuntu-22.04, windows-latest, etc)"
type: string
required: false
default: ubuntu-latest
version:
description: 'OpenDAQ version (if not set, resolves to latest from openDAQ/openDAQ)'
required: false
platform:
description: 'Target platform (if not set, auto-detected)'
required: false
packaging:
description: 'Packaging format for cpack (if not set, uses runner OS name)'
required: false

jobs:
test-compose-filename-manually:
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Compose openDAQ framework filename
id: call-framework-compose-filename
uses: ./framework-compose-filename
with:
version: ${{ inputs.version }}
platform: ${{ inputs.platform }}
packaging: ${{ inputs.packaging }}

- name: Display Results
shell: bash
run: |
echo "╔══════════════════════════════════════════════════════════════════════════════╗"
echo "║ Package Filename Composition Results ║"
echo "╠══════════════════════════════════════════════════════════════════════════════╣"
echo "║ 🏷️ Version (full): ${{ steps.call-framework-compose-filename.outputs.version }}"
echo "║ ├─ Major: ${{ steps.call-framework-compose-filename.outputs.version-major }}"
echo "║ ├─ Minor: ${{ steps.call-framework-compose-filename.outputs.version-minor }}"
echo "║ ├─ Patch: ${{ steps.call-framework-compose-filename.outputs.version-patch }}"
echo "║ ├─ Suffix: ${{ steps.call-framework-compose-filename.outputs.version-suffix || '*** NOT SET ***' }}"
echo "║ └─ Hash: ${{ steps.call-framework-compose-filename.outputs.version-hash || '*** NOT SET ***' }}"
echo "╠══════════════════════════════════════════════════════════════════════════════╣"
echo "║ 🖥️ Platform (full): ${{ steps.call-framework-compose-filename.outputs.platform }}"
echo "║ ├─ OS Name: ${{ steps.call-framework-compose-filename.outputs.platform-os-name }}"
echo "║ ├─ OS Version: ${{ steps.call-framework-compose-filename.outputs.platform-os-version }}"
echo "║ └─ Architecture: ${{ steps.call-framework-compose-filename.outputs.platform-os-arch }}"
echo "╠══════════════════════════════════════════════════════════════════════════════╣"
echo "║ 📦 Packaging: ${{ steps.call-framework-compose-filename.outputs.packaging }}"
echo "╠══════════════════════════════════════════════════════════════════════════════╣"
echo "║ 📄 Filename: ${{ steps.call-framework-compose-filename.outputs.filename }}"
echo "╚══════════════════════════════════════════════════════════════════════════════╝"
82 changes: 82 additions & 0 deletions .github/workflows/test-framework-download-release-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test Download Release Asset

on:
workflow_dispatch:
inputs:
runner-os:
description: 'Runner OS to use'
required: true
type: string
default: 'ubuntu-latest'

version:
description: 'Release version (e.g., v3.20.4) or "latest"'
required: false
type: string
default: 'latest'

platform:
description: 'Target platform (e.g., ubuntu22.04-x86_64, win64) or leave empty for auto-detect'
required: false
type: string
default: ''

packaging:
description: 'Package format override (e.g., deb, exe, tar.gz, zip) or leave empty for auto-detect'
required: false
type: string
default: ''

asset-pattern:
description: 'Custom glob pattern to filter assets (overrides auto-detection)'
required: false
type: string
default: ''

output-dir:
description: 'Output directory for downloaded assets (leave empty for runner.temp)'
required: false
type: string
default: ''

verbose:
description: 'Enable verbose output'
required: false
type: boolean
default: true

jobs:
download-release:
name: Download on ${{ inputs.runner-os }}
runs-on: ${{ inputs.runner-os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download OpenDAQ release asset
id: download
uses: ./framework-download-release
with:
version: ${{ inputs.version }}
platform: ${{ inputs.platform }}
packaging: ${{ inputs.packaging }}
asset-pattern: ${{ inputs.asset-pattern }}
output-dir: ${{ inputs.output-dir }}
verbose: ${{ inputs.verbose }}

- name: Display results
shell: bash
run: |
echo "=== Download Results ==="
echo ""
echo "📦 Asset: ${{ steps.download.outputs.asset-filename }}"
echo "📍 Path: ${{ steps.download.outputs.asset }}"
echo "📂 Directory: ${{ steps.download.outputs.asset-dir }}"
echo ""
echo "🏷️ Version: ${{ steps.download.outputs.version }}"
echo "🖥️ Platform: ${{ steps.download.outputs.platform }}"
echo "📦 Packaging: ${{ steps.download.outputs.packaging }}"
echo ""
echo "📊 Size: ${{ steps.download.outputs.asset-filesize }} bytes"
echo "🔐 SHA256: ${{ steps.download.outputs.asset-checksum }}"
188 changes: 188 additions & 0 deletions framework-compose-filename/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# Compose OpenDAQ Package Filename

Composes OpenDAQ installation package filename from version, platform, and packaging format.

## Usage

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
with:
# OpenDAQ version (if not set, resolves to latest from openDAQ/openDAQ)
# Optional
version: ''

# Target platform (if not set, auto-detected)
# Optional
platform: ''

# Packaging format for cpack (if not set, uses runner OS name)
# Optional
packaging: ''
```

## Outputs

```yaml
outputs:
filename: # Composed package filename
version: # Resolved version (full)
version-major: # Version major component
version-minor: # Version minor component
version-patch: # Version patch component
version-suffix: # Version suffix (rc or empty)
version-hash: # Version hash (or empty)
platform: # Resolved platform (full)
platform-os-name: # Platform OS name
platform-os-version: # Platform OS version (empty for Windows)
platform-os-arch: # Platform OS architecture
packaging: # Resolved packaging format
```

## Format Specifications

### Version Format

Supports semantic versioning with optional prefix, suffix, and git hash:

| Format | Example | Type | Use Case |
|--------|---------|------|----------|
| `X.YY.Z` | `1.2.3` | Release | Production releases (no prefix) |
| `vX.YY.Z` | `v1.2.3` | Release | Production releases (with prefix) |
| `X.YY.Z-rc` | `1.2.3-rc` | RC | Release candidates |
| `vX.YY.Z-rc` | `v1.2.3-rc` | RC | Release candidates (with prefix) |
| `X.YY.Z-HASH` | `1.2.3-a1b2c3d` | Dev | Development builds |
| `vX.YY.Z-HASH` | `v1.2.3-a1b2c3d` | Dev | Development builds (with prefix) |

**Components**:
- **Major** (`X`): 0-999+
- **Minor** (`YY`): 0-999
- **Patch** (`Z`): 0-999+
- **Suffix**: `rc` (release candidate) or git hash (7-40 lowercase hex chars)
- **Prefix**: `v` (optional)

### Platform Format

Platform identifiers follow these patterns:

**Linux/macOS**: `{os}{version}-{arch}`
- **OS**: `ubuntu`, `debian`, `macos`
- **Version**: `20.04`, `22.04`, `24.04` (Ubuntu/Debian) or `13`, `14`, `15` (macOS)
- **Architecture**: `arm64`, `x86_64`
- Examples: `ubuntu22.04-x86_64`, `macos14-arm64`, `debian12-arm64`

**Windows**: `win{arch}`
- **Architecture**: `32`, `64` (bits, not x86/x64)
- Examples: `win64`, `win32`

**Supported Platforms**:
- Ubuntu: 20.04, 22.04, 24.04
- Debian: 8, 9, 10, 11, 12
- macOS: 13-18, 26 (Ventura to Sequoia + future)
- Windows: 32-bit, 64-bit

### Packaging Format

File extensions for installation packages:

| OS | Format | Extension | CPack Generator |
|----|--------|-----------|-----------------|
| **Windows** | Installer | `.exe` | `NSIS`, `NSIS64`, `WIX` |
| **Ubuntu/Debian** | Package | `.deb` | `DEB` |
| **macOS** | Archive | `.tar.gz` | `TGZ` |
| **macOS** | Archive | `.zip` | `ZIP` |

The action automatically detects the appropriate packaging format based on the runner OS or CPack generator.

## Examples

### Default (auto-detect everything)

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose

# Result: opendaq-3.30.0-ubuntu22.04-x86_64.deb
```

### Specify version

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
version: 'v3.29.0-rc'

# Result: opendaq-3.29.0-rc-ubuntu22.04-x86_64.deb
```

### Specify version without prefix

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
version: '3.29.0-rc'

# Result: opendaq-3.29.0-rc-ubuntu22.04-x86_64.deb
```

### Specify platform

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
platform: 'win64'

# Result: opendaq-3.30.0-win64.exe
```

### Release candidate

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
version: 'v3.29.0-rc'
platform: 'macos14-arm64'

# Result: opendaq-3.29.0-rc-macos14-arm64.tar.gz
```

### Development build with hash

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
version: 'v3.30.0-a1b2c3d'
platform: 'debian12-x86_64'

# Result: opendaq-3.30.0-a1b2c3d-debian12-x86_64.deb
```

### Full specification

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose
with:
version: 'v3.29.0-rc'
platform: 'ubuntu22.04-x86_64'
packaging: 'DEB'

# Result: opendaq-3.29.0-rc-ubuntu22.04-x86_64.deb
```

### Using outputs

```yaml
- uses: openDAQ/openDAQ/.github/actions/framework-compose-filename@main
id: compose

- name: Download package
run: |
echo "Filename: ${{ steps.compose.outputs.filename }}"
echo "Version: ${{ steps.compose.outputs.version }}"
echo "Platform: ${{ steps.compose.outputs.platform }}"
```
Loading