-
Notifications
You must be signed in to change notification settings - Fork 21
119 lines (105 loc) · 4.95 KB
/
build-installer.yml
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
name: build-installer-any
on:
workflow_dispatch:
inputs:
installer_type:
type: choice
description: 'Installer Type'
required: true
options:
- offline
- espressif-ide
- online
esp_idf_version:
description: 'ESP-IDF version (e.g. 5.2 or 5.2.1)'
required: false
default: ''
espressif_ide_version:
description: 'Espressif IDE version (e.g. 2.0.0)'
required: false
default: ''
online_installer_version:
description: 'Online Installer version (e.g. 2.0)'
required: false
default: ''
pull_request: # TODO
env:
# TODO not constants!
INSTALLER_TYPE: "online" #${{ inputs.installer_type }}
ESP_IDF_VERSION: "4.4.7" #${{ inputs.esp_idf_version }}
ESPRESSIF_IDE_VERSION: "" #${{ inputs.espressif_ide_version }}
ONLINE_INSTALLER_VERSION: "2.25" #${{ inputs.online_installer_version }}
# Based on this defined supported IDF versions are created installer buttons in index.html from releases.json
SUPPORTED_IDF_VERSIONS: ('5.2', '4.4', '5.1', '5.0')
jobs:
build-installer-online:
name: Build Online Installer
if: ${{ inputs.installer_type }} == 'online'
uses: espressif/idf-installer/.github/workflows/build-online-installer.yml@feat/automatic_installer_release #TODO
with:
online_installer_version: "2.25" #${{ inputs.online_installer_version }} TODO
secrets: inherit
#build-installer-offline:
# name: Build Offline Installer
# if: ${{ inputs.installer_type }} == 'offline'
# uses: espressif/idf-installer/.github/workflows/build-offline-installer.yml@feat/automatic_installer_release #TODO
# with:
# esp_idf_version: ${{ inputs.esp_idf_version}}
# secrets: inherit
# build-installer-ide:
# name: Build IDE Installer
# if: ${{ inputs.installer_type }} == 'espressif-ide'
# uses: espressif/idf-installer/.github/workflows/build-espressif-ide-installer.yml@feat/automatic_installer_release #TODO
# with:
# esp_idf_version: ${{ inputs.esp_idf_version }}
# espressif_ide_version: ${{ inputs.espressif_ide_version }}
# secrets: inherit
update-docs-files:
needs: [build-installer-online] # TODO
name: Create ${{ inputs.installer_type}} installer release PR
if: ${{ always() }} && (${{ needs.build-installer-ide.result }} == 'success' || ${{ needs.build-installer-offline.result }} == 'success' || ${{ needs.build-installer-online.result }} == 'success')
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: installer-size
path: ./
- name: Install script requirements
run: pip install -r scripts/requirements.txt
- name: Get size of online installer and Update docs files
run: |
echo "Instaler size from variable is $(Get-Content variables.txt)"
$size_bytes = [int]$(Get-Content variables.txt)
# Check if the content is larger than 100000
if ($size_bytes -gt 9999999) {
$result = [math]::Round($size_bytes / 1000000000,2)
$installer_size = "$result GB"
echo "INSTALLER_SIZE: $installer_size"
} else {
$result = [math]::Round($size_bytes / 1000000,2)
$installer_size = "$result MB"
echo "INSTALLER_SIZE: $installer_size"
}
python scripts/docs_update_release.py $installer_size
- name: Delete variables.txt
run: |
Remove-Item -Path variables.txt -Force
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'Release ${{ env.INSTALLER_TYPE }} installer ${{env.ESPRESSIF_IDE_VERSION}}${{env.ONLINE_INSTALLER_VERSION}} with ESP-IDF v${{ env.ESP_IDF_VERSION }}'
title: 'Release ${{ env.INSTALLER_TYPE }} installer ${{env.ESPRESSIF_IDE_VERSION}}${{env.ONLINE_INSTALLER_VERSION}} with ESP-IDF v${{ env.ESP_IDF_VERSION }}'
body: '- Updated docs files'
branch: 'release-${{ env.INSTALLER_TYPE }}-installer'
delete-branch: true
base: 'main'