Skip to content

Commit 1aa05a3

Browse files
authored
update workflow [skip actions]
1 parent 91a1d6e commit 1aa05a3

File tree

1 file changed

+33
-70
lines changed

1 file changed

+33
-70
lines changed
Lines changed: 33 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# This is a basic workflow to help you get started with Actions
2-
name: Manually executable test for ESP-IDF v4.3.1
1+
name: Platform Build
32
on:
3+
push:
4+
branches:
5+
- '**4.3'
46
workflow_dispatch:
57
inputs:
6-
ui_build:
7-
description: 'Rebuild UI'
8-
required: true
9-
type: boolean
10-
release_build:
11-
description: 'Release'
12-
required: true
13-
type: boolean
14-
# push:
15-
# branches:
16-
# - '**4.3'
8+
ui_build:
9+
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'
10+
required: true
11+
type: boolean
12+
release_build:
13+
description: 'Force a Release build. When not forced, the system will check for release word in the last commit message to trigger a release'
14+
required: true
15+
type: boolean
1716

1817
jobs:
1918
bootstrap:
@@ -27,12 +26,6 @@ jobs:
2726
release_flag: ${{ steps.build_flags.outputs.release_flag }}
2827
mock: ${{ steps.build_flags.outputs.mock }}
2928
steps:
30-
- name: Set Build options from workflow dispatch event
31-
run: |
32-
ui_build_option="" && [[ ${{ inputs.ui_build }} ]] && ui_build_option="--ui_build"
33-
release_build_option="" && [[ ${{ inputs.release_build }} ]] && release_build_option="--force"
34-
echo "ui_build_option=$ui_build_option" >> $GITHUB_ENV
35-
echo "release_build_option=$release_build_option" >> $GITHUB_ENV
3629
- uses: actions/checkout@v2
3730
with:
3831
fetch-depth: 0
@@ -46,33 +39,26 @@ jobs:
4639
id: build_flags
4740
run: |
4841
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
42+
[ ${{github.event.inputs.ui_build}} ] && ui_build_option="--ui_build" || ui_build_option=""
43+
[ ${{github.event.inputs.release_build}} ] && release_build_option="--force" || release_build_option=""
44+
echo "ui_build_option=$ui_build_option" >> $GITHUB_ENV
45+
echo "release_build_option=$release_build_option" >> $GITHUB_ENV
4946
echo "Dumping environment"
5047
env
5148
. /opt/esp/python_env/idf4.3_py3.8_env/bin/activate
5249
# build_flags support the following options
5350
# --mock - to mock the compilation part - this is to be used for testing only
5451
# --force - to force a release build even if the last commit message doesn't contain the word "release"
5552
# --ui_build - to force a ui_build even if the last commit message doesn't contain "[ui-build]"
56-
build_tools.py build_flags ${{ env.ui_build_option }} ${{ env.release_build_option }}
57-
preparation:
58-
name: Preparation
59-
needs: bootstrap
60-
runs-on: ubuntu-latest
61-
container:
62-
image: sle118/squeezelite-esp32-idfv43
63-
steps:
53+
build_tools.py build_flags $ui_build_option $release_build_option
6454
- name: Show Build Flags
6555
run: |
6656
echo "Running with the following options"
67-
echo "Web Build Flag=${{needs.bootstrap.outputs.ui_build}}"
68-
echo "Mock flag=${{needs.bootstrap.outputs.mock}}"
69-
echo "Release Flag=${{needs.bootstrap.outputs.release_flag}}"
70-
git config --global --add safe.directory /__w/squeezelite-esp32/squeezelite-esp32
71-
- uses: actions/checkout@v2
72-
with:
73-
fetch-depth: 0
74-
submodules: true
57+
echo "Web Build Flag=${{steps.build_flags.outputs.ui_build}}"
58+
echo "Mock flag=${{steps.build_flags.outputs.mock}}"
59+
echo "Release Flag=${{steps.build_flags.outputs.release_flag}}"
7560
- name: Refresh certificates
61+
if: ${{ steps.build_flags.outputs.release_flag }}
7662
run: |
7763
git update-index --chmod=+x ./server_certs/getcert.sh
7864
cd server_certs;./getcert.sh;cat github.pem;cd ..
@@ -84,13 +70,13 @@ jobs:
8470
cache: 'npm'
8571
cache-dependency-path: components/wifi-manager/webapp/package.json
8672
- name: Build Web Application
87-
if: ${{ needs.bootstrap.outputs.ui_build == 1 }}
73+
if: ${{ steps.build_flags.outputs.ui_build == 1 }}
8874
run: |
8975
cd components/wifi-manager/webapp/
9076
npm install
9177
npm run-script build
9278
- name: Update repository with prebuilt items
93-
if: ${{ needs.bootstrap.outputs.ui_build == 1 || needs.bootstrap.outputs.release_flag == 1 }}
79+
if: ${{ steps.build_flags.outputs.ui_build == 1 || steps.build_flags.outputs.release_flag == 1 }}
9480
run: |
9581
git config user.name github-actions
9682
git config user.email [email protected]
@@ -115,7 +101,7 @@ jobs:
115101
runs-on: ubuntu-latest
116102
container:
117103
image: sle118/squeezelite-esp32-idfv43
118-
needs: [preparation,bootstrap]
104+
needs: [bootstrap]
119105
strategy:
120106
matrix:
121107
node: [I2S-4MFlash, SqueezeAmp, Muse]
@@ -189,7 +175,7 @@ jobs:
189175
zip -r build_output.zip build
190176
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
191177
fi
192-
- name: Upload Artifacts
178+
- name: Upload Build Artifacts
193179
uses: actions/upload-artifact@v3
194180
if: ${{ needs.bootstrap.outputs.mock == 0 }}
195181
with:
@@ -201,17 +187,10 @@ jobs:
201187
partitions.csv
202188
sdkconfig
203189
server_certs/github.pem
190+
build/*.bin
191+
build/bootloader/bootloader.bin
192+
build/partition_table/partition-table.bin
204193
build_output.zip
205-
- name: Save Last Build
206-
if: ${{ needs.bootstrap.outputs.mock == 0 }}
207-
uses: actions/upload-artifact@v3
208-
with:
209-
name: build_parms
210-
path: |
211-
build/flash_project_args
212-
build/flasher_args.json
213-
partitions.csv
214-
sdkconfig
215194
- name: Create Release
216195
if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
217196
id: create_release
@@ -245,25 +224,9 @@ jobs:
245224
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
246225
asset_path: build/${{ env.artifact_file_name }}
247226
asset_name: ${{ env.artifact_file_name }}
248-
asset_content_type: application/octet-stream
227+
asset_content_type: application/octet-stream
249228
update_web_installer:
250-
name: Web Installer
251-
if: ${{ needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
252-
needs: [build, preparation,bootstrap]
253-
runs-on: ubuntu-latest
254-
container:
255-
image: sle118/squeezelite-esp32-idfv43
256-
steps:
257-
- uses: actions/checkout@v2
258-
with:
259-
fetch-depth: 0
260-
submodules: true
261-
- uses: actions/download-artifact@master
262-
name: Restore last build
263-
with:
264-
name: build_parms
265-
- name: Update Web Installer Project
266-
run: |
267-
. /opt/esp/python_env/idf4.3_py3.8_env/bin/activate
268-
build_tools.py manifest --flash_file "./build/flasher_args.json" --outdir "./bin_files" --manif_name "manifest" --max_count 3
269-
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}}"
229+
name: Update Web Installer After Release
230+
needs: [ bootstrap, build ]
231+
if: ${{( always() && !cancelled() ) && needs.bootstrap.outputs.release_flag == 1 && needs.bootstrap.outputs.mock == 0 }}
232+
uses: ./.github/workflows/web_deploy.yml

0 commit comments

Comments
 (0)