Feat/automatic installer release #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-installer-any | |
on: | |
workflow_dispatch: | |
inputs: | |
installer_type: | |
type: choice | |
description: 'Installer Type' | |
required: true | |
options: | |
- offline | |
- espressif-ide | |
- online | |
installer_size: | |
description: 'Installer Size (e.g 1.69 GB)' | |
required: true | |
default: '1.5 GB' | |
esp_idf_version: | |
description: 'ESP-IDF version (e.g. 5.2 or 5.2.1)' | |
required: false | |
default: '5.2.1' | |
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 Remove this once the workflow is tested | |
env: | |
INSTALLER_TYPE: "online" #${{ inputs.installer_type }} | |
INSTALLER_SIZE: "" #${{ inputs.installer_size }} | |
ESP_IDF_VERSION: "5.2.1" #${{ inputs.esp_idf_version }} | |
ESPRESSIF_IDE_VERSION: #${{ inputs.espressif_ide_version }} | |
ONLINE_INSTALLER_VERSION: "1.69" #${{ inputs.online_installer_version }} | |
jobs: | |
build-installer-online: | |
#needs: update-docs-files | |
name: Build Online Installer | |
#if: ${{ env.INSTALLER_TYPE }} == 'online' | |
uses: espressif/idf-installer/.github/workflows/build-online-installer.yml@feat/automatic_installer_release # TODO | |
with: | |
online_installer_version: ${{ inputs.online_installer_version }} | |
secrets: inherit | |
# build-installer-offline: | |
# #needs: update-docs-files | |
# name: Build Offline Installer | |
# # if: ${{ env.INSTALLER_TYPE }} == 'offline' | |
# uses: espressif/idf-installer/.github/workflows/build-offline-installer.yml@feat/automatic_installer_release # TODO | |
# with: | |
# esp_idf_version: "5.2.1" | |
# secrets: inherit | |
# build-installer-ide: | |
# needs: update-docs-files | |
# name: Build IDE Installer | |
# if: ${{ env.INSTALLER_TYPE }} == 'espressif-ide' | |
# uses: espressif/idf-installer/.github/workflows/build-espressif-ide-installer.yml@feat/automatic_installer_release # TODO | |
# with: | |
# esp_idf_version: ${{ env.ESP_IDF_VERSION }} | |
# espressif_ide_version: ${{ env.ESPRESSIF_IDE_VERSION }} | |
# secrets: inherit | |
update-docs-files: | |
needs: build-installer-online | |
name: Build ${{ inputs.installer_type}} Installer | |
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: Get size of online installer | |
run: | | |
echo "Instaler size from variable is $(Get-Content variables.txt)" | |
echo "Installer size from env before assignment ${{ env.INSTALLER_SIZE }}" | |
$size_bytes = [int]$(Get-Content variables.txt) | |
# Check if the content is larger than 100000 | |
if ($size_bytes -gt 9999999) { | |
$result = $value / 1000000000 | |
$env.INSTALLER_SIZE = '$result GB' | |
} else { | |
$result = $value / 100000 | |
$env.INSTALLER_SIZE = '$result MB' | |
} | |
echo "Installer size from env after assignment ${{ env.INSTALLER_SIZE }}" | |
# - name: Update docs files | |
# run: | | |
# python scripts/docs_update_release.py | |
# - 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' |