From 4c650d74ccbd9f48b3ef234a6328b2235f4f8bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 14 Dec 2023 15:23:22 +0000 Subject: [PATCH] feat(config): Include sample config file in release ZIP Implements #689 --- .github/workflows/ci.yaml | 27 +++++++++++++++-- .github/workflows/insiders-build.yaml | 30 +++++++++++++++++-- .../engine/LocalLogConfig.xml | 0 .../proxy/LocalLogConfig.xml | 0 .../repository/LocalLogConfig.xml | 0 .../scheduler/LocalLogConfig.xml | 0 6 files changed, 52 insertions(+), 5 deletions(-) rename {docs/log_appenders => src/config/log_appender_xml}/engine/LocalLogConfig.xml (100%) rename {docs/log_appenders => src/config/log_appender_xml}/proxy/LocalLogConfig.xml (100%) rename {docs/log_appenders => src/config/log_appender_xml}/repository/LocalLogConfig.xml (100%) rename {docs/log_appenders => src/config/log_appender_xml}/scheduler/LocalLogConfig.xml (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0be8d213..4ed8076d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -134,8 +134,14 @@ jobs: # Notarize release binary echo "Creating temp notarization archive for release binary" - # ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}.zip" - ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" + zip -r "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" "./${DIST_FILE_NAME}" -x "*.DS_Store" + ## ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}.zip" + #ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" + + # Add additional files to the zip file + cd src + zip -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-macos.zip" "./config/production_template.yaml" "./config/log_appender_xml" -x "*.DS_Store" + cd .. # Here we send the notarization request to the Apple's Notarization service, waiting for the result. # This typically takes a few seconds inside a CI environment, but it might take more depending on the App @@ -237,6 +243,15 @@ jobs: } Compress-Archive @compress + # Add following directories & files to the created zip file, in the ./config directory. + # - ./src/config/production_template.yaml + # - ./src/config/log_appender_xml + mkdir config + Copy-Item -Path ./src/config/log_appender_xml -Destination ./config/ -Recurse + Copy-Item -Path ./src/config/production_template.yaml -Destination ./config/ + + Compress-Archive -Path "./config" -Update -DestinationPath "./${env:DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-win.zip" + - name: Upload to existing release uses: ncipollo/release-action@v1 with: @@ -302,9 +317,17 @@ jobs: - name: Compress release binary run: | + # Compress insider's build + # Include following directories & files in the created archive file. + # - ./src/config/log_appender_xml + # - ./src/config⁄production_template.yaml + ls -la zip -9 -r ./${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-linux.zip ${DIST_FILE_NAME} + cd src + zip -9 -u -r "../${DIST_FILE_NAME}-${{ needs.release-please.outputs.release_tag_name }}-linux.zip" "./config/production_template.yaml" "./config/log_appender_xml" + - name: Debug run: | ls -la diff --git a/.github/workflows/insiders-build.yaml b/.github/workflows/insiders-build.yaml index 50c6df23..014522bc 100644 --- a/.github/workflows/insiders-build.yaml +++ b/.github/workflows/insiders-build.yaml @@ -49,7 +49,16 @@ jobs: DestinationPath = "${env:DIST_FILE_NAME}--win-x64--${{ github.sha }}.zip" } Compress-Archive @compress - # dir + + # Add following directories & files to the created zip file, in the ./config directory. + # - ./src/config/production_template.yaml + # - ./src/config/log_appender_xml + mkdir config + Copy-Item -Path ./src/config/log_appender_xml -Destination ./config/ -Recurse + Copy-Item -Path ./src/config/production_template.yaml -Destination ./config/ + + Compress-Archive -Path "./config" -Update -DestinationPath "./${env:DIST_FILE_NAME}--win-x64--${{ github.sha }}.zip" + # artifact_release_name: release-binaries-win # artifact_release_path: release-binaries-win/* artifact_insider: butler-sos--win-x64--${{ github.sha }}.zip @@ -95,7 +104,13 @@ jobs: # Notarize insider binary echo "Creating temp notarization archive for insider build" - ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}--macos-x64--${{ github.sha }}.zip" + # ditto -c -k --keepParent "./${DIST_FILE_NAME}" "./${DIST_FILE_NAME}--macos-x64--${{ github.sha }}.zip" + zip -r "./${DIST_FILE_NAME}--macos-x64--${{ github.sha }}.zip" "./${DIST_FILE_NAME}" -x "*.DS_Store" + + # Add additional files to the zip file + cd src + zip -u -r "../${DIST_FILE_NAME}--macos-x64--${{ github.sha }}.zip" "./config/production_template.yaml" "./config/log_appender_xml" -x "*.DS_Store" + cd .. # Here we send the notarization request to the Apple's Notarization service, waiting for the result. # This typically takes a few seconds inside a CI environment, but it might take more depending on the App @@ -117,7 +132,16 @@ jobs: chmod +x ${DIST_FILE_NAME} # Compress insider's build - tar -czf "${DIST_FILE_NAME}--linux-x64--${{ github.sha }}.tgz" "${DIST_FILE_NAME}" + # Include following directories & files in the created archive file. + # - ./src/config/log_appender_xml + # - ./src/config⁄production_template.yaml + + ls -la + zip -9 -r ./${DIST_FILE_NAME}--linux-x64--${{ github.sha }}.zip ${DIST_FILE_NAME} + + cd src + zip -9 -u -r "../${DIST_FILE_NAME}--linux-x64--${{ github.sha }}.zip" "./config/production_template.yaml" "./config/log_appender_xml" + ls -la # artifact_release_name: release-binaries-linux diff --git a/docs/log_appenders/engine/LocalLogConfig.xml b/src/config/log_appender_xml/engine/LocalLogConfig.xml similarity index 100% rename from docs/log_appenders/engine/LocalLogConfig.xml rename to src/config/log_appender_xml/engine/LocalLogConfig.xml diff --git a/docs/log_appenders/proxy/LocalLogConfig.xml b/src/config/log_appender_xml/proxy/LocalLogConfig.xml similarity index 100% rename from docs/log_appenders/proxy/LocalLogConfig.xml rename to src/config/log_appender_xml/proxy/LocalLogConfig.xml diff --git a/docs/log_appenders/repository/LocalLogConfig.xml b/src/config/log_appender_xml/repository/LocalLogConfig.xml similarity index 100% rename from docs/log_appenders/repository/LocalLogConfig.xml rename to src/config/log_appender_xml/repository/LocalLogConfig.xml diff --git a/docs/log_appenders/scheduler/LocalLogConfig.xml b/src/config/log_appender_xml/scheduler/LocalLogConfig.xml similarity index 100% rename from docs/log_appenders/scheduler/LocalLogConfig.xml rename to src/config/log_appender_xml/scheduler/LocalLogConfig.xml