-
Notifications
You must be signed in to change notification settings - Fork 24
111 lines (96 loc) · 3.88 KB
/
Copy pathbuild_sdsio-server.yml
File metadata and controls
111 lines (96 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build sdsio-server
on:
workflow_dispatch:
inputs:
trigger_extension_build:
description: 'Trigger CMSIS SDS extension build as part of this workflow.'
required: false
default: false
type: boolean
release:
types:
- published
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2025, ubuntu-24.04, macos-15, ubuntu-24.04-arm]
include:
- os: windows-2025
artifact_name: sdsio-server-windows
- os: ubuntu-24.04
artifact_name: sdsio-server-linux
- os: macos-15
artifact_name: sdsio-server-macos
- os: ubuntu-24.04-arm
artifact_name: sdsio-server-linux-arm64
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Setup Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.11"
- name: Install PyInstaller
run: pip install pyinstaller
- name: Install dependencies
run: pip install -r ./utilities/requirements.txt
- name: Extract SDSIO-Server version
shell: bash
run: |
SDSIO_SERVER_VERSION=$(sed -nE "s/^SDSIO_SERVER_VERSION[[:space:]]*=[[:space:]]*['\"]([^'\"]+)['\"].*/\1/p" utilities/sdsio-server.py | head -n 1)
test -n "$SDSIO_SERVER_VERSION" || { echo "Failed to extract SDSIO_SERVER_VERSION from utilities/sdsio-server.py"; exit 1; }
echo "SDSIO_SERVER_VERSION=$SDSIO_SERVER_VERSION" >> "$GITHUB_ENV"
- name: Build executable
run: |
pyinstaller --clean --noconfirm --onefile --name sdsio-server utilities/sdsio-server.py
- name: Check executable version
shell: bash
run: |
EXECUTABLE_OUTPUT=$(dist/sdsio-server --version 2>&1 | tr -d '\r')
echo "$EXECUTABLE_OUTPUT"
EXECUTABLE_VERSION=$(echo "$EXECUTABLE_OUTPUT" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z]+)?' | head -n 1)
[[ "$EXECUTABLE_VERSION" == "$SDSIO_SERVER_VERSION" ]] || {
echo "Version mismatch: expected $SDSIO_SERVER_VERSION, got $EXECUTABLE_VERSION"
exit 1
}
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.artifact_name }}-${{ env.SDSIO_SERVER_VERSION }}
path: dist/sdsio-server*
retention-days: 7
# Triggers the CMSIS SDS extension nightly workflow
trigger-sds-extn:
needs: [ build ]
if: >-
success() && github.repository == 'ARM-software/SDS-Framework' &&
((github.event_name == 'workflow_dispatch' && github.event.inputs.trigger_extension_build) || github.event_name == 'schedule')
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Trigger vscode-cmsis-sds workflow
run: |
curl --fail-with-body --show-error --silent -X POST \
-H "Authorization: Bearer ${{ secrets.CROSS_REPO_SDS_EXTN_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
https://api.github.com/repos/Open-CMSIS-Pack/vscode-cmsis-sds/actions/workflows/nightly.yml/dispatches \
-d '{"ref":"main"}'