forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 2.39 KB
/
upload_esp_idf_component.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
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
name: Upload component to ESP-IDF component registry
on:
workflow_dispatch:
inputs:
release:
type: boolean
default: false
required: false
description: "Release? Uploads to esp-idf component registry if true"
jobs:
upload_components:
runs-on: ubuntu-22.04
container: espressif/idf:latest
steps:
- uses: actions/checkout@v4
- name: Extract Version
working-directory: api/cpp/esp-idf/slint
id: version
run: |
version=$(grep -oP '(?<=GIT_TAG v)[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt)
if [[ -z "$version" ]]; then
echo "Version not found"
exit 1
fi
echo "VERSION=$version" >> $GITHUB_OUTPUT
- name: Remove use of nightly version
if: github.event.inputs.release == 'true'
working-directory: api/cpp/esp-idf/slint
run: |
sed -i "s/find_package(Slint)/find_package(Slint ${{ steps.version.outputs.VERSION }})/g" CMakeLists.txt
if ! grep -q 'find_package(Slint 1\.)' CMakeLists.txt; then
echo "Substituting the choice of nightly Slint against the released version failed. Check this script and CMakeLists.txt"
exit 1
fi
- name: Upload component
if: github.event.inputs.release == 'true'
uses: espressif/upload-components-ci-action@v1
with:
name: "slint"
namespace: "slint"
api_token: ${{ secrets.ESP_IDF_COMPONENTS_TOKEN }}
directories: "api/cpp/esp-idf/slint"
- name: Package component
if: github.event.inputs.release != 'true'
working-directory: "api/cpp/esp-idf/slint"
run: |
. ${IDF_PATH}/export.sh
compote component pack --name slint
- name: Archive component
if: github.event.inputs.release != 'true'
uses: actions/upload-artifact@v4
with:
path: "api/cpp/esp-idf/slint/dist/*"