-
Notifications
You must be signed in to change notification settings - Fork 3
141 lines (121 loc) · 4.55 KB
/
linux-build.yaml
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Linux build
on: push
jobs:
build-linux-bindings:
name: Build Linux bindings
runs-on: ubuntu-22.04-16-cores
permissions:
contents: write
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Docker Buildx (if you want cross-platform support, otherwise you can skip this)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Step 3: Navigate to the src directory and build the Docker image
- name: Build Docker image
run: |
cd openvino_bindings
docker build -f Dockerfile.ubuntu -t linux-bindings-ubuntu .
docker create --name bindings_container linux-bindings-ubuntu
docker cp bindings_container:/bindings-out/linux_bindings.tgz ./linux_bindings.tgz
docker rm bindings_container
pwd
ls -lh
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: "linux_bindings.tgz"
path: openvino_bindings/linux_bindings.tgz
if-no-files-found: error
build-linux-ui:
name: Build Linux UI
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.5'
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable linux build
run: flutter config --enable-linux-desktop
- name: Build artifacts
run: flutter build linux --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: "OpenVINO-TestDrive-no-bindings-linux.zip"
path: build/linux/x64/release/bundle
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: "OpenVINO-TestDrive-no-bindings-linux.zip"
path: build/linux/x64/release/bundle
package:
name: Package combined Linux release
runs-on: ubuntu-22.04
needs: [ build-linux-bindings, build-linux-ui ] # Waits for both jobs to succeed
steps:
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set filename for release
- name: Set safe filename
id: set_filename
run: |
SAFE_REF_NAME=${GITHUB_REF_NAME//\//_}
echo "SANITIZED_FILENAME=OpenVINO-TestDrive-${SAFE_REF_NAME}-linux.zip" >> $GITHUB_ENV
# Step 3: Download artifact from build-linux-ui
- name: Download bindings build artifact
uses: actions/download-artifact@v4
with:
name: "linux_bindings.tgz" # Matches the artifact name from build-linux-ui
path: ./bindings # Directory to store the downloaded artifact
# Step 4: Download artifact from build-linux-ui
- name: Download flutter build artifact
uses: actions/download-artifact@v4
with:
name: "OpenVINO-TestDrive-no-bindings-linux.zip" # Matches the artifact name from build-linux-ui
path: ./flutter # Directory to store the downloaded artifact
# Step 5: Combine artifacts
- name: Combine artifacts
run: |
ls -la ./
ls -la ./bindings
ls -la ./flutter
tar -xvf ./bindings/linux_bindings.tgz -C ./bindings
rm ./bindings/linux_bindings.tgz
ls -la ./bindings
mkdir -p ./flutter/data/flutter_assets/bindings
mv ./bindings/* ./flutter/data/flutter_assets/bindings
# Step 5: Archive combined folder
- name: Archive Release artifact
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.SANITIZED_FILENAME }}
path: ./flutter/
# Step 5: Upload new artifact
- name: Upload Release Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.SANITIZED_FILENAME }}
path: ./flutter/
# Step 6: Update release
- name: Linux Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.SANITIZED_FILENAME }}