From 458d7eacbe7a1f93d04b09bfbad44938b6077dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Fri, 17 Dec 2021 09:52:36 -0500 Subject: [PATCH 1/2] Update CrossBuild.yml --- .github/workflows/CrossBuild.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CrossBuild.yml b/.github/workflows/CrossBuild.yml index d492b372..6369a3eb 100644 --- a/.github/workflows/CrossBuild.yml +++ b/.github/workflows/CrossBuild.yml @@ -2,9 +2,11 @@ name: Cross-Build on: push: - branches-ignore: [ master ethernet_idf4.3 ] + branches: + - 'master-cmake' pull_request: - branches-ignore: [ master ethernet_idf4.3 ] + branches: + - 'master-cmake' jobs: job1: From 205502546820378902500dc96a949bd616b537d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Fri, 17 Dec 2021 10:52:15 -0500 Subject: [PATCH 2/2] Add idf4.3 build to the default branch --- .github/workflows/esp-idf-v4.3-build.yml | 157 +++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 .github/workflows/esp-idf-v4.3-build.yml diff --git a/.github/workflows/esp-idf-v4.3-build.yml b/.github/workflows/esp-idf-v4.3-build.yml new file mode 100644 index 00000000..1232fde0 --- /dev/null +++ b/.github/workflows/esp-idf-v4.3-build.yml @@ -0,0 +1,157 @@ +# This is a basic workflow to help you get started with Actions +name: ESP-IDF v4.3.1 +on: + push: + branches: + - '**4.3' + pull_request: + branches: + - '**4.3' +jobs: + job1: + name: Build Number + runs-on: ubuntu-latest + outputs: + build_number: ${{ steps.buildnumber.outputs.build_number }} + steps: + - name: Generate common build number + id: buildnumber + uses: einaregilsson/build-number@v3 + with: + token: ${{secrets.github_token}} + build: + runs-on: ubuntu-latest + needs: job1 + strategy: + max-parallel: 1 + matrix: + node: [I2S-4MFlash, SqueezeAmp] + depth: [16, 32] + steps: + - name: Set target name + run: | + echo "TARGET_BUILD_NAME=${{ matrix.node }}" >> $GITHUB_ENV + echo "build_version_prefix=1." >> $GITHUB_ENV + - uses: actions/checkout@v2 + with: + fetch-depth: 15 + submodules: true + - name: Cache build + id: cache-build + uses: actions/cache@v2 + with: + path: | + build + /var/lib/docker + key: idf4.3-${{ runner.os }}-${{ matrix.node }}-${{ matrix.depth }} + - name: Set build parameters + run: | + git update-index --chmod=+x ./server_certs/getcert.sh + cd server_certs;./getcert.sh;cat github.pem;cd .. + shopt -s nocasematch + branch_name="${GITHUB_REF//refs\/heads\//}" + branch_name="${branch_name//[^a-zA-Z0-9\-~!@_\.]/}" + BUILD_NUMBER=${{ needs.job1.outputs.build_number }} + echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV + tag="${TARGET_BUILD_NAME}.${{matrix.depth}}.${BUILD_NUMBER}.${branch_name}" + echo "tag=${tag}" >> $GITHUB_ENV + last_commit="$(git log --pretty=format:'%s' --max-count=1)" + if [[ "$last_commit" =~ .*"Release".* ]]; then echo "release_flag=1" >> $GITHUB_ENV; else echo "release_flag=0" >> $GITHUB_ENV; fi + name="1.${BUILD_NUMBER}-${{matrix.depth}}#v4.0#${TARGET_BUILD_NAME}#${branch_name}" + artifact_prefix="squeezelite-esp32-${branch_name}-${TARGET_BUILD_NAME}-${{matrix.depth}}-${build_version_prefix}${BUILD_NUMBER}" + artifact_file_name="${artifact_prefix}.zip" + artifact_bin_file_name="${artifact_prefix}.bin" + echo "name=${name}" >> $GITHUB_ENV + echo "last_commit=${last_commit}" >> $GITHUB_ENV + echo "artifact_file_name=${artifact_file_name}" >> $GITHUB_ENV + echo "PROJECT_VER=${TARGET_BUILD_NAME}-${{ steps.buildnumber.outputs.build_number }} " >> $GITHUB_ENV + echo "artifact_bin_file_name=${artifact_bin_file_name}" >> $GITHUB_ENV + description="" + description=${description}$'------------------------------\n### Revision Log\n\n' + description="$description$(git log --pretty=format:'%h %s (%cI) <%an>' --abbrev-commit --max-count=15 | sed --r 's/(^[\*]+)/\\\1/g') " + echo 'description<<~EOD' >> $GITHUB_ENV + echo ${description}>> $GITHUB_ENV + echo '~EOD' >> $GITHUB_ENV + echo ####### + echo ####### Environment + echo ####### + env + echo ####### + echo ####### GITHUB ENV + echo ####### + cat $GITHUB_ENV + - name: Build the firmware + run: | + env | grep "artifact\|tag\|GITHUB\|version\|NUMBER\|TARGET" >${TARGET_BUILD_NAME}-env.txt + echo "${tag}" >version.txt + echo pulling docker version 4.3.1 + docker pull espressif/idf:v4.3.1 + docker info + docker run --env-file=${TARGET_BUILD_NAME}-env.txt -v $PWD:/project -w /project espressif/idf:v4.3.1 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && idf.py build -DDEPTH=${{ matrix.depth }} -DBUILD_NUMBER=${BUILD_NUMBER}-${{ matrix.depth }} && zip -r build_output.zip build && zip build/${artifact_file_name} partitions*.csv build/*.bin build/bootloader/bootloader.bin build/partition_table/partition-table.bin build/flash_project_args build/size_*.txt" + # - name: Build Mock firmware + # run: | + # mkdir -p build + # cd build + # mkdir -p partition_table + # mkdir -p bootloader + # echo "mock content"> squeezelite.bin + # echo "mock content"> recovery.bin + # echo "mock content"> ./bootloader/bootloader.bin + # echo "mock content"> ./partition_table/partition-table.bin + # echo "mock content"> flash_project_args + # echo "mock content"> size_comp1.txt + # echo "mock content"> size_comp2.txt + # echo "mock content"> ../partitions.csv + - uses: actions/upload-artifact@v2 + with: + name: ${{ env.artifact_file_name }} + path: | + build/*.bin + build/bootloader/bootloader.bin + build/partition_table/partition-table.bin + build/flash_project_args + build/size_comp1.txt + build/size_comp2.txt + partitions.csv + sdkconfig + server_certs/github.pem + build_output.zip + - uses: actions/upload-artifact@v2 + with: + name: ${{ env.artifact_bin_file_name }} + path: | + build/squeezelite.bin + - name: Create Release + if: env.release_flag == 1 + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ env.tag }} + release_name: ${{ env.name }} + body: ${{ env.description }} + draft: false + prerelease: true + - name: Upload Release Asset - Squeezelite binary file + if: env.release_flag == 1 + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + 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 + asset_path: build/squeezelite.bin + asset_name: ${{ env.artifact_bin_file_name }} + asset_content_type: application/octet-stream + - name: Upload Release Asset - Zip file + if: env.release_flag == 1 + id: upload-release-asset-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + 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 + asset_path: build/${{ env.artifact_file_name }} + asset_name: ${{ env.artifact_file_name }} + asset_content_type: application/octet-stream