Update Github Build and config command

This commit is contained in:
Sebastien
2020-10-26 18:17:17 -04:00
parent 33ad6d5950
commit 4825dc6644
8 changed files with 53 additions and 122 deletions

View File

@@ -31,15 +31,15 @@ jobs:
run: |
echo "TARGET_BUILD_NAME=${{ matrix.node }}" >> $GITHUB_ENV
echo "build_version_prefix=V0." >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
submodules: true
- name: Cache build
id: cache-build
uses: actions/cache@v1
with:
path: ${{github.RUNNER_WORKSPACE}}/build
key: ${{ runner.os }}-${TARGET_BUILD_NAME}
- uses: actions/checkout@v2
with:
submodules: true
- name: Set build parameters
run: |
shopt -s nocasematch
@@ -70,23 +70,22 @@ jobs:
echo "Target is ${TARGET_BUILD_NAME}"
env
- name: Build the firmware
if: env.release_flag == 1 && env.release_flag == 0
run: |
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && export PROJECT_VER=${TARGET_BUILD_NAME}-${{ steps.buildnumber.outputs.build_number }} && idf.py build && zip ${artifact_file_name} ../partitions*.csv *.bin ./bootloader/bootloader.bin ./partition_table/partition-table.bin flash_project_args ./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
# - 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 }}
@@ -104,19 +103,19 @@ jobs:
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 }}
# - 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
# release_name: ${{ env.name }}
# body: ${{ env.description }}
# draft: false
# prerelease: true

View File

@@ -1,36 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: ESP32-A1S
on:
push:
branches: [ master-cmake ]
pull_request:
branches: [ master-cmake ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set target
run: echo "TARGET_BUILD_NAME=ESP32-A1S" >> $GITHUB_ENV
id: target-name-generator
- name: Show Target
run: echo "Target is ${TARGET_BUILD_NAME}"
- uses: actions/checkout@v2
with:
submodules: true
- name: Generate build number
id: buildnumber
uses: einaregilsson/build-number@v2
with:
token: ${{secrets.github_token}}
- name: Cache build
id: cache-build
uses: actions/cache@v1
with:
path: ${{github.workspace}}/build
key: ${{ runner.os }}-${TARGET_BUILD_NAME}
- name: Build the firmware
run: |
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && export PROJECT_VER=${TARGET_BUILD_NAME}-${{ steps.buildnumber.outputs.build_number }} && idf.py build"

View File

@@ -1,36 +0,0 @@
# This is a basic workflow to help you get started with Actions
name: SqueezeAmp
on:
push:
branches: [ master-cmake ]
pull_request:
branches: [ master-cmake ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set target
run: echo "TARGET_BUILD_NAME=SqueezeAmp" >> $GITHUB_ENV
id: target-name-generator
- name: Show Target
run: echo "Target is ${TARGET_BUILD_NAME}"
- uses: actions/checkout@v2
with:
submodules: true
- name: Generate build number
id: buildnumber
uses: einaregilsson/build-number@v2
with:
token: ${{secrets.github_token}}
- name: Cache build
id: cache-build
uses: actions/cache@v1
with:
path: ${{github.workspace}}/build
key: ${{ runner.os }}-${TARGET_BUILD_NAME}
- name: Build the firmware
run: |
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 /bin/bash -c "cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig && export PROJECT_VER=${TARGET_BUILD_NAME}-${{ steps.buildnumber.outputs.build_number }} && idf.py build"

View File

@@ -11,5 +11,7 @@ include(squeezelite.cmake)
set(PROJECT_VER $ENV{PROJECT_VER})
#target_compile_definitions(__idf_squeezelite-ota PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
#target_compile_definitions(__idf_driver_bt PRIVATE -DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
#target_compile_definitions(__idf_squeezelite-ota PRIVATE DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
#target_compile_definitions(__idf_driver_bt PRIVATE DLOG_LOCAL_LEVEL=ESP_LOG_VERBOSE)
target_compile_definitions(__idf_main PUBLIC MODEL_NAME=SqueezeESP32)
target_compile_definitions(__idf_platform_console PUBLIC MODEL_NAME=SqueezeESP32)

View File

@@ -8,6 +8,6 @@ idf_component_register( SRCS
cmd_config.c
INCLUDE_DIRS .
REQUIRES nvs_flash
PRIV_REQUIRES console app_update tools services spi_flash platform_config vfs pthread wifi-manager platform_config newlib telnet display )
PRIV_REQUIRES console app_update tools services spi_flash platform_config vfs pthread wifi-manager platform_config newlib telnet display squeezelite)
target_link_libraries(${COMPONENT_LIB} "-Wl,--undefined=GDS_DrawPixelFast")
target_link_libraries(${COMPONENT_LIB} ${build_dir}/esp-idf/$<TARGET_PROPERTY:RECOVERY_PREFIX>/lib$<TARGET_PROPERTY:RECOVERY_PREFIX>.a )

View File

@@ -25,23 +25,23 @@ const char * desc_spdif= "SPDIF Options";
const char * desc_audio= "General Audio Options";
#define CODECS_BASE "flac,pcm,mp3,ogg"
#define CODECS_BASE "flac|pcm|mp3|ogg"
#if NO_FAAD
#define CODECS_AAC ""
#else
#define CODECS_AAC ",aac"
#define CODECS_AAC "|aac"
#endif
#if FFMPEG
#define CODECS_FF ",wma,alac"
#define CODECS_FF "|wma|alac"
#else
#define CODECS_FF ""
#endif
#if DSD
#define CODECS_DSD ",dsd"
#define CODECS_DSD "|dsd"
#else
#define CODECS_DSD ""
#endif
#define CODECS_MP3 " (mad,mpg for specific mp3 codec)"
#define CODECS_MP3 "|mad|mpg"
#define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_DSD CODECS_MP3
#define NOT_OUTPUT "has input capabilities only"
@@ -75,6 +75,8 @@ static struct {
struct arg_end *end;
} audio_args;
static struct {
struct arg_str * output_device; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
struct arg_str * name;// " -n <name>\t\tSet the player name\n"
struct arg_str * server; // -s <server>[:<port>]\tConnect to specified server, otherwise uses autodiscovery to find server\n"
struct arg_str * buffers;// " -b <stream>:<output>\tSpecify internal Stream and Output buffer sizes in Kbytes\n"
struct arg_str * codecs;// " -c <codec1>,<codec2>\tRestrict codecs to those specified, otherwise load all available codecs; known codecs: " CODECS "\n"
@@ -88,7 +90,6 @@ static struct {
#if IR
struct arg_str * log_level_ir;
#endif
struct arg_str * output_device; // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
// " -e <codec1>,<codec2>\tExplicitly exclude native support of one or more codecs; known codecs: " CODECS "\n"
// " -f <logfile>\t\tWrite debug to logfile\n"
// #if IR
@@ -96,7 +97,6 @@ static struct {
// #endif
struct arg_str * mac_addr; // " -m <mac addr>\t\tSet mac address, format: ab:cd:ef:12:34:56\n"
struct arg_str * model_name;// " -M <modelname>\tSet the squeezelite player model name sent to the server (default: " MODEL_NAME_STRING ")\n"
struct arg_str * name;// " -n <name>\t\tSet the player name\n"
struct arg_lit * header_format;// " -W\t\t\tRead wave and aiff format from header, ignore server parameters\n"
struct arg_str * rates; // " -r <rates>[:<delay>]\tSample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms\n"
#if RESAMPLE
@@ -160,10 +160,10 @@ static int do_audio_cmd(int argc, char **argv){
if(audio_args.jack_behavior->count>0){
err = ESP_OK; // suppress any error code that might have happened in a previous step
if(strcasecmp(audio_args.jack_behavior->sval[0],"Headphones")){
if(strcasecmp(audio_args.jack_behavior->sval[0],"Headphones")==0){
err = config_set_value(NVS_TYPE_STR, "jack_mutes_amp", "y");
}
else if(strcasecmp(audio_args.jack_behavior->sval[0],"Subwoofer")){
else if(strcasecmp(audio_args.jack_behavior->sval[0],"Subwoofer")==0){
err = config_set_value(NVS_TYPE_STR, "jack_mutes_amp", "n");
}
else {
@@ -382,7 +382,7 @@ cJSON * spdif_cb(){
cJSON * audio_cb(){
cJSON * values = cJSON_CreateObject();
char * p = config_alloc_get_default(NVS_TYPE_STR, "jack_mutes_amp", "n", 0);
cJSON_AddBoolToObject(values,"jack_behavior",(strcmp(p,"1") == 0 ||strcasecmp(p,"y") == 0));
cJSON_AddStringToObject(values,"jack_behavior",(strcmp(p,"1") == 0 ||strcasecmp(p,"y") == 0)?"Headphones":"Subwoofer");
FREE_AND_NULL(p);
return values;
}
@@ -561,7 +561,7 @@ static void register_audio_config(void){
static void register_squeezelite_config(void){
squeezelite_args.server = arg_str0("s","server","<server>[:<port>]","Connect to specified server, otherwise uses autodiscovery to find server");
squeezelite_args.buffers = arg_str0("b","buffers","<stream>:<output>","Internal Stream and Output buffer sizes in Kbytes");
squeezelite_args.codecs = arg_strn("c","codecs","<codec1>,<codec2>",0,20,"Restrict codecs to those specified, otherwise load all available codecs; known codecs");
squeezelite_args.codecs = arg_strn("c","codecs","+" CODECS "+",0,20,"Restrict codecs to those specified, otherwise load all available codecs; known codecs: " CODECS );
squeezelite_args.timeout = arg_int0("C","timeout","<n>","Close output device when idle after timeout seconds, default is to keep it open while player is 'on");
squeezelite_args.log_level = arg_str0("d","loglevel","log=level","Set logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug"); // " -d <log>=<level>\tSet logging level, logs: all|slimproto|stream|decode|output|ir, level: info|debug|sdebug\n"
// squeezelite_args.log_level_all = arg_str0(NULL,"all",get_log_level_options("all"),"Overall Logging Level");
@@ -573,10 +573,10 @@ static void register_squeezelite_config(void){
squeezelite_args.log_level_ir= arg_str0(NULL,"loglevel_ir",get_log_level_options("ir"),"IR Logging Level");
#endif
squeezelite_args.output_device = arg_str0("o","output_device","<string>","Output device");
squeezelite_args.mac_addr = arg_str0("m","mac_addr","<string>","Mac address, format: ab:cd:ef:12:34:56");
squeezelite_args.model_name = arg_str0("M", "modelname", "<string>","Squeezelite player model name sent to the server");
squeezelite_args.name = arg_str0("n","name","<string>","Player name");
squeezelite_args.output_device = arg_str0("o","output_device","<string>","Output device (BT, I2S or SPDIF)");
squeezelite_args.mac_addr = arg_str0("m","mac_addr","<string>","Mac address, format: ab:cd:ef:12:34:56.");
squeezelite_args.model_name = arg_str0("M", "modelname", "<string>","Set the squeezelite player model name sent to the server (default: " MODEL_NAME ")");
squeezelite_args.name = arg_str0("n","name","<string>","Player name, if different from the current host name. Name can alternatively be assigned from the system/device name configuration.");
squeezelite_args.header_format = arg_lit0("W","header_format","Read wave and aiff format from header, ignore server parameters");
squeezelite_args.rates = arg_str0("r","rates","<rates>[:<delay>]", "Sample rates supported, allows output to be off when squeezelite is started; rates = <maxrate>|<minrate>-<maxrate>|<rate1>,<rate2>,<rate3>; delay = optional delay switching rates in ms\n");
#if RESAMPLE

View File

@@ -1169,7 +1169,8 @@ function getCommands() {
} else {
innerhtml += '<div class="form-group" ><label for="' + ctrlname + '">' + arg.glossary.encodeHTML() + '</label>';
if (placeholder.includes('|')) {
placeholder = placeholder.replace('<', '').replace('>', '');
extraclass = (placeholder.startsWith('+')? ' multiple ':'');
placeholder = placeholder.replace('<', '').replace('=', '').replace('>', '');
innerhtml += '<select ' + attributes + ' class="form-control '+extraclass+'"';
placeholder = '--|' + placeholder;
placeholder.split('|').forEach(function(choice) {
@@ -1263,6 +1264,7 @@ function getConfig() {
$("input#dhcp-name1").val(val);
$("input#dhcp-name2").val(val);
$("#player").val(val);
document.title=val;
}
$("tbody#nvsTable").append(