|
| 1 | +name: Determine latest openDAQ framework artefact |
| 2 | + |
| 3 | +inputs: |
| 4 | + win32-force: |
| 5 | + required: false |
| 6 | + default: false |
| 7 | + |
| 8 | +outputs: |
| 9 | + version: |
| 10 | + description: "Latest openDAQ release version" |
| 11 | + value: ${{ steps.determine-latest-package.outputs.version }} |
| 12 | + platform: |
| 13 | + description: "Detected platform" |
| 14 | + value: ${{ steps.determine-latest-package.outputs.platform }} |
| 15 | + packaging: |
| 16 | + description: "Package type (deb/exe)" |
| 17 | + value: ${{ steps.determine-latest-package.outputs.packaging }} |
| 18 | + artefact: |
| 19 | + description: "Artefact filename" |
| 20 | + value: ${{ steps.determine-latest-package.outputs.artefact }} |
| 21 | + uri: |
| 22 | + description: "Full URI to artefact" |
| 23 | + value: ${{ steps.determine-latest-package.outputs.uri }} |
| 24 | + scheme: |
| 25 | + description: "Scheme (s3)" |
| 26 | + value: ${{ steps.determine-latest-package.outputs.scheme }} |
| 27 | + authority: |
| 28 | + description: "Authority (bucket)" |
| 29 | + value: ${{ steps.determine-latest-package.outputs.authority }} |
| 30 | + path: |
| 31 | + description: "Path inside bucket" |
| 32 | + value: ${{ steps.determine-latest-package.outputs.path }} |
| 33 | + |
| 34 | +runs: |
| 35 | + using: composite |
| 36 | + steps: |
| 37 | + - name: Determine latest openDAQ package |
| 38 | + id: determine-latest-package |
| 39 | + shell: bash |
| 40 | + run: | |
| 41 | + set -e |
| 42 | +
|
| 43 | + version=$(gh api repos/openDAQ/openDAQ/releases/latest --jq '.tag_name') |
| 44 | + if [[ -z "$version" || "$version" == "null" ]]; then |
| 45 | + echo "::error::Failed to determine latest openDAQ release version" |
| 46 | + exit 1 |
| 47 | + fi |
| 48 | +
|
| 49 | + version=${version#v} |
| 50 | + platform="" |
| 51 | + packaging="" |
| 52 | +
|
| 53 | + if [[ "$RUNNER_OS" == "Linux" ]]; then |
| 54 | + arch=$(uname -m) |
| 55 | + if [[ "$arch" == "x86_64" ]]; then |
| 56 | + platform="ubuntu22.04-x86_64" |
| 57 | + elif [[ "$arch" == "aarch64" ]]; then |
| 58 | + platform="ubuntu22.04-arm64" |
| 59 | + else |
| 60 | + echo "::error::Unsupported Linux arch: $arch" |
| 61 | + exit 1 |
| 62 | + fi |
| 63 | + packaging="deb" |
| 64 | +
|
| 65 | + elif [[ "$RUNNER_OS" == "Windows" ]]; then |
| 66 | + WIN32_FORCE="${{ inputs.win32-force }}" |
| 67 | + if [[ "$WIN32_FORCE" == "true" ]]; then |
| 68 | + platform="win32" |
| 69 | + else |
| 70 | + platform="win64" |
| 71 | + fi |
| 72 | + packaging="exe" |
| 73 | +
|
| 74 | + else |
| 75 | + echo "::error::Unsupported runner OS $RUNNER_OS" |
| 76 | + exit 1 |
| 77 | + fi |
| 78 | +
|
| 79 | + artefact="opendaq-${version}-${platform}.${packaging}" |
| 80 | + scheme="s3" |
| 81 | + authority="bb-blueberry-sdk-releases" |
| 82 | + sdk="releases/v${version}/SDK" |
| 83 | +
|
| 84 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 85 | + echo "platform=$platform" >> $GITHUB_OUTPUT |
| 86 | + echo "packaging=$packaging" >> $GITHUB_OUTPUT |
| 87 | + echo "artefact=$artefact" >> $GITHUB_OUTPUT |
| 88 | + echo "scheme=$scheme" >> $GITHUB_OUTPUT |
| 89 | + echo "authority=$authority" >> $GITHUB_OUTPUT |
| 90 | + echo "path=$sdk" >> $GITHUB_OUTPUT |
| 91 | + echo "uri=${scheme}://${authority}/${sdk}/${artefact}" >> $GITHUB_OUTPUT |
0 commit comments