update workflow [skip actions]

This commit is contained in:
Sébastien
2022-11-29 10:18:48 -05:00
committed by GitHub
parent 91a1d6e39e
commit 1aa05a3e32

View File

@@ -1,19 +1,18 @@
# This is a basic workflow to help you get started with Actions name: Platform Build
name: Manually executable test for ESP-IDF v4.3.1
on: on:
push:
branches:
- '**4.3'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ui_build: ui_build:
description: 'Rebuild UI' description: 'Force Rebuilding the UI. When not forced, the system will check for [ui-build] in the last commit message to trigger a ui rebuild'
required: true required: true
type: boolean type: boolean
release_build: release_build:
description: 'Release' description: 'Force a Release build. When not forced, the system will check for release word in the last commit message to trigger a release'
required: true required: true
type: boolean type: boolean
# push:
# branches:
# - '**4.3'
jobs: jobs:
bootstrap: bootstrap:
@@ -27,12 +26,6 @@ jobs:
release_flag: ${{ steps.build_flags.outputs.release_flag }} release_flag: ${{ steps.build_flags.outputs.release_flag }}
mock: ${{ steps.build_flags.outputs.mock }} mock: ${{ steps.build_flags.outputs.mock }}
steps: steps:
- name: Set Build options from workflow dispatch event
run: |
ui_build_option="" && [[ ${{ inputs.ui_build }} ]] && ui_build_option="--ui_build"
release_build_option="" && [[ ${{ inputs.release_build }} ]] && release_build_option="--force"
echo "ui_build_option=$ui_build_option" >> $GITHUB_ENV
echo "release_build_option=$release_build_option" >> $GITHUB_ENV
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -46,6 +39,10 @@ jobs:
id: build_flags id: build_flags
run: | run: |
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32 git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
[ ${{github.event.inputs.ui_build}} ] && ui_build_option="--ui_build" || ui_build_option=""
[ ${{github.event.inputs.release_build}} ] && release_build_option="--force" || release_build_option=""
echo "ui_build_option=$ui_build_option" >> $GITHUB_ENV
echo "release_build_option=$release_build_option" >> $GITHUB_ENV
echo "Dumping environment" echo "Dumping environment"
env env
. /opt/esp/python_env/idf4.3_py3.8_env/bin/activate . /opt/esp/python_env/idf4.3_py3.8_env/bin/activate
@@ -53,26 +50,15 @@ jobs:
# --mock - to mock the compilation part - this is to be used for testing only # --mock - to mock the compilation part - this is to be used for testing only
# --force - to force a release build even if the last commit message doesn't contain the word "release" # --force - to force a release build even if the last commit message doesn't contain the word "release"
# --ui_build - to force a ui_build even if the last commit message doesn't contain "[ui-build]" # --ui_build - to force a ui_build even if the last commit message doesn't contain "[ui-build]"
build_tools.py build_flags ${{ env.ui_build_option }} ${{ env.release_build_option }} build_tools.py build_flags $ui_build_option $release_build_option
preparation:
name: Preparation
needs: bootstrap
runs-on: ubuntu-latest
container:
image: sle118/squeezelite-esp32-idfv43
steps:
- name: Show Build Flags - name: Show Build Flags
run: | run: |
echo "Running with the following options" echo "Running with the following options"
echo "Web Build Flag=${{needs.bootstrap.outputs.ui_build}}" echo "Web Build Flag=${{steps.build_flags.outputs.ui_build}}"
echo "Mock flag=${{needs.bootstrap.outputs.mock}}" echo "Mock flag=${{steps.build_flags.outputs.mock}}"
echo "Release Flag=${{needs.bootstrap.outputs.release_flag}}" echo "Release Flag=${{steps.build_flags.outputs.release_flag}}"
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Refresh certificates - name: Refresh certificates
if: ${{ steps.build_flags.outputs.release_flag }}
run: | run: |
git update-index --chmod=+x ./server_certs/getcert.sh git update-index --chmod=+x ./server_certs/getcert.sh
cd server_certs;./getcert.sh;cat github.pem;cd .. cd server_certs;./getcert.sh;cat github.pem;cd ..
@@ -84,13 +70,13 @@ jobs:
cache: 'npm' cache: 'npm'
cache-dependency-path: components/wifi-manager/webapp/package.json cache-dependency-path: components/wifi-manager/webapp/package.json
- name: Build Web Application - name: Build Web Application
if: ${{ needs.bootstrap.outputs.ui_build == 1 }} if: ${{ steps.build_flags.outputs.ui_build == 1 }}
run: | run: |
cd components/wifi-manager/webapp/ cd components/wifi-manager/webapp/
npm install npm install
npm run-script build npm run-script build
- name: Update repository with prebuilt items - name: Update repository with prebuilt items
if: ${{ needs.bootstrap.outputs.ui_build == 1 || needs.bootstrap.outputs.release_flag == 1 }} if: ${{ steps.build_flags.outputs.ui_build == 1 || steps.build_flags.outputs.release_flag == 1 }}
run: | run: |
git config user.name github-actions git config user.name github-actions
git config user.email github-actions@github.com git config user.email github-actions@github.com
@@ -115,7 +101,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: sle118/squeezelite-esp32-idfv43 image: sle118/squeezelite-esp32-idfv43
needs: [preparation,bootstrap] needs: [bootstrap]
strategy: strategy:
matrix: matrix:
node: [I2S-4MFlash, SqueezeAmp, Muse] node: [I2S-4MFlash, SqueezeAmp, Muse]
@@ -189,7 +175,7 @@ jobs:
zip -r build_output.zip build zip -r build_output.zip build
zip build/${artifact_file_name} partitions*.csv components/ build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt zip build/${artifact_file_name} partitions*.csv components/ build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt
fi fi
- name: Upload Artifacts - name: Upload Build Artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
if: ${{ needs.bootstrap.outputs.mock == 0 }} if: ${{ needs.bootstrap.outputs.mock == 0 }}
with: with:
@@ -201,17 +187,10 @@ jobs:
partitions.csv partitions.csv
sdkconfig sdkconfig
server_certs/github.pem server_certs/github.pem
build/*.bin
build/bootloader/bootloader.bin
build/partition_table/partition-table.bin
build_output.zip build_output.zip
- name: Save Last Build
if: ${{ needs.bootstrap.outputs.mock == 0 }}
uses: actions/upload-artifact@v3
with:
name: build_parms
path: |
build/flash_project_args
build/flasher_args.json
partitions.csv
sdkconfig
- name: Create Release - name: Create Release
if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }} if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
id: create_release id: create_release
@@ -247,23 +226,7 @@ jobs:
asset_name: ${{ env.artifact_file_name }} asset_name: ${{ env.artifact_file_name }}
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
update_web_installer: update_web_installer:
name: Web Installer name: Update Web Installer After Release
if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }} needs: [ bootstrap, build ]
needs: [build, preparation,bootstrap] if: ${{( always() && !cancelled() ) && needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
runs-on: ubuntu-latest uses: ./.github/workflows/web_deploy.yml
container:
image: sle118/squeezelite-esp32-idfv43
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- uses: actions/download-artifact@master
name: Restore last build
with:
name: build_parms
- name: Update Web Installer Project
run: |
. /opt/esp/python_env/idf4.3_py3.8_env/bin/activate
build_tools.py manifest --flash_file "./build/flasher_args.json" --outdir "./bin_files" --manif_name "manifest" --max_count 3
build_tools.py pushinstaller --source "./bin_files" --manif_name "manifest" --target "web-installer" --url "https://github.com/sle118/squeezelite-esp32-installer.git" --artifacts "artifacts" --web_installer_branch "main" --token "${{secrets.github_token}}"