diff --git a/.github/actions/multi-do-upload/action.yml b/.github/actions/multi-do-upload/action.yml new file mode 100644 index 0000000..d50ebac --- /dev/null +++ b/.github/actions/multi-do-upload/action.yml @@ -0,0 +1,89 @@ +name: Upload Files to DigitalOcean Spaces +description: Upload multiple files to DigitalOcean Spaces based on a YAML array input. + +inputs: + files: + description: A YAML array of files to upload with their paths relative to the repository root. + required: true + space_name: + description: The name of the DigitalOcean Space. + required: true + space_region: + description: The region of the DigitalOcean Space. + required: true + storage_type: + description: The storage class to use (e.g., STANDARD). + required: false + default: STANDARD + access_key: + description: The access key for DigitalOcean Spaces. + required: true + secret_key: + description: The secret key for DigitalOcean Spaces. + required: true + space_path: + description: The path within the Space where files will be uploaded. + required: true + acl: + description: The Access-Control List (ACL) for the files (e.g., public or private). + required: false + default: public + +runs: + using: "composite" + steps: + - name: Validate Input Parameters + id: validate_inputs + shell: bash + run: | + FILES=$(echo "${{ inputs.files }}" | awk NF) + if [ -z "$FILES" ]; then + echo "Error: No files specified for upload." + exit 1 + fi + echo "Files to upload: $FILES" >> $GITHUB_STEP_SUMMARY + + - name: Upload Files to DigitalOcean Spaces + shell: bash + env: + SPACE: ${{ inputs.space_name }} + REGION: ${{ inputs.space_region }} + STORAGETYPE: ${{ inputs.storage_type }} + KEY: ${{ inputs.access_key }} + SECRET: ${{ inputs.secret_key }} + SPACE_PATH: ${{ inputs.space_path }} + ACL: ${{ inputs.acl }} + run: | + # Function to upload a file to DigitalOcean Spaces + function putS3 { + local path=$1 + local file=$2 + local space_path=$3 + local space="${SPACE}" + local date=$(date +"%a, %d %b %Y %T %z") + local acl="x-amz-acl:${ACL}" + local content_type=$(file --mime-type -b "$path/$file") + local storage_type="x-amz-storage-class:${STORAGETYPE}" + local string="PUT\n\n$content_type\n$date\n$acl\n$storage_type\n/$space$space_path$file" + local signature=$(echo -en "${string}" | openssl sha1 -hmac "${SECRET}" -binary | base64) + curl -s -X PUT -T "$path/$file" \ + -H "Host: $space.${REGION}.digitaloceanspaces.com" \ + -H "Date: $date" \ + -H "Content-Type: $content_type" \ + -H "$storage_type" \ + -H "$acl" \ + -H "Authorization: AWS ${KEY}:$signature" \ + "https://$space.${REGION}.digitaloceanspaces.com$space_path$file" + } + + # Process and upload each file + FILES=$(echo "${{ inputs.files }}" | tr -d '[]' | tr ',' '\n' | sed 's/"//g' | awk NF) + for file_path in $FILES; do + if [ -f "$file_path" ]; then + file_name=$(basename "$file_path") + echo "Uploading $file_name to ${SPACE}/${SPACE_PATH}" >> $GITHUB_STEP_SUMMARY + putS3 "$(dirname "$file_path")" "$file_name" "/${SPACE_PATH}/" + else + echo "Warning: File $file_path does not exist. Skipping." >> $GITHUB_STEP_SUMMARY + fi + done diff --git a/.github/actions/multi-folder-zip/action.yml b/.github/actions/multi-folder-zip/action.yml new file mode 100644 index 0000000..8926d36 --- /dev/null +++ b/.github/actions/multi-folder-zip/action.yml @@ -0,0 +1,100 @@ +name: Rename and Zip Folders Action +description: Renames folders in input_dir, zips them, and places the zip files in output_dir. + +inputs: + input_dir: + description: The directory containing the original folders. + required: true + output_dir: + description: The directory where zip files will be placed. + required: true + names: + description: A YAML array of directory names to check within input_dir. + required: true + filename_new: + description: A YAML array of new folder names to rename the folders. + required: true + +outputs: + zipped_files: + description: A list of paths to the zipped files. + value: ${{ steps.process_folders.outputs.zipped_files }} + +runs: + using: "composite" + steps: + - name: Validate Input Parameters + id: validate_inputs + shell: bash + run: | + INPUT_DIR=${{ inputs.input_dir }} + OUTPUT_DIR=${{ inputs.output_dir }} + NAMES=$(echo "${{ inputs.names }}" | awk NF) + FILENAME_NEW=$(echo "${{ inputs.filename_new }}" | awk NF) + + # Ensure output directory exists + if [ ! -d "$OUTPUT_DIR" ]; then + echo "Creating output directory: $OUTPUT_DIR" + mkdir -p "$OUTPUT_DIR" + fi + + # Check array lengths match + LEN_NAMES=$(echo "$NAMES" | wc -l) + LEN_NEW=$(echo "$FILENAME_NEW" | wc -l) + if [ "$LEN_NAMES" -ne "$LEN_NEW" ]; then + echo "Error: The input arrays must have the same length." >> $GITHUB_STEP_SUMMARY + exit 1 + fi + + echo "Input parameters validated successfully." >> $GITHUB_STEP_SUMMARY + + - name: Process Folders + id: process_folders + shell: bash + run: | + INPUT_DIR=${{ inputs.input_dir }} + OUTPUT_DIR=${{ inputs.output_dir }} + NAMES=$(echo "${{ inputs.names }}" | awk NF) + FILENAME_NEW=$(echo "${{ inputs.filename_new }}" | awk NF) + + echo "## Listing Input Directory Contents" >> $GITHUB_STEP_SUMMARY + ls -la "$INPUT_DIR" >> $GITHUB_STEP_SUMMARY + + # Initialize array to store zipped file paths + ZIPPED_FILES=() + + # Process each entry in the arrays + paste <(echo "$NAMES") <(echo "$FILENAME_NEW") | while IFS=$'\t' read -r OLD_FOLDER_NAME NEW_FOLDER_NAME; do + OLD_FOLDER_PATH="$INPUT_DIR/$OLD_FOLDER_NAME" + NEW_FOLDER_PATH="$INPUT_DIR/$NEW_FOLDER_NAME" + + if [ ! -d "$OLD_FOLDER_PATH" ]; then + echo "Error: Directory $OLD_FOLDER_PATH does not exist. Skipping." >> $GITHUB_STEP_SUMMARY + continue + fi + + # Rename the folder + mv "$OLD_FOLDER_PATH" "$NEW_FOLDER_PATH" + if [ $? -ne 0 ]; then + echo "Error: Failed to rename $OLD_FOLDER_PATH to $NEW_FOLDER_PATH" >> $GITHUB_STEP_SUMMARY + continue + fi + echo "Successfully renamed $OLD_FOLDER_PATH to $NEW_FOLDER_PATH" >> $GITHUB_STEP_SUMMARY + + # Zip the folder + ZIP_FILE="$OUTPUT_DIR/${NEW_FOLDER_NAME}.zip" + zip -r "$ZIP_FILE" "$NEW_FOLDER_PATH" > /dev/null + if [ $? -eq 0 ]; then + echo "Successfully zipped $NEW_FOLDER_PATH to $ZIP_FILE" >> $GITHUB_STEP_SUMMARY + ZIPPED_FILES+=("$ZIP_FILE") + else + echo "Error: Failed to zip $NEW_FOLDER_PATH" >> $GITHUB_STEP_SUMMARY + fi + done + + # Convert zipped files array to JSON and set output + echo "Zipped files: ${ZIPPED_FILES[@]}" >> $GITHUB_STEP_SUMMARY + echo "zipped_files=$(echo "${ZIPPED_FILES[@]}" | jq -c -R 'split(" ")')" >> $GITHUB_OUTPUT + + echo "## Listing Output Directory Contents" >> $GITHUB_STEP_SUMMARY + ls -la "$OUTPUT_DIR" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/multi-rename-inplace/action.yml b/.github/actions/multi-rename-inplace/action.yml new file mode 100644 index 0000000..5a49914 --- /dev/null +++ b/.github/actions/multi-rename-inplace/action.yml @@ -0,0 +1,90 @@ +name: Rename Files in Place Action +description: Renames files in the same folder based on provided arrays. + +inputs: + input_dir: + description: The directory containing the original files. + required: true + names: + description: A YAML array of directory names to check within input_dir. + required: true + filename_old: + description: A YAML array of old filenames to rename. + required: true + filename_new: + description: A YAML array of new filenames for the renamed files. + required: true + +outputs: + renamed_files: + description: A list of paths to the renamed files. + value: ${{ steps.process_files.outputs.renamed_files }} + +runs: + using: "composite" + steps: + - name: Validate Input Parameters + id: validate_inputs + shell: bash + run: | + INPUT_DIR=${{ inputs.input_dir }} + NAMES=$(echo "${{ inputs.names }}" | awk NF) + FILENAME_OLD=$(echo "${{ inputs.filename_old }}" | awk NF) + FILENAME_NEW=$(echo "${{ inputs.filename_new }}" | awk NF) + + # Check array lengths match + LEN_NAMES=$(echo "$NAMES" | wc -l) + LEN_OLD=$(echo "$FILENAME_OLD" | wc -l) + LEN_NEW=$(echo "$FILENAME_NEW" | wc -l) + if [ "$LEN_NAMES" -ne "$LEN_OLD" ] || [ "$LEN_OLD" -ne "$LEN_NEW" ]; then + echo "Error: All input arrays must have the same length." >> $GITHUB_STEP_SUMMARY + exit 1 + fi + + echo "Input parameters validated successfully." >> $GITHUB_STEP_SUMMARY + + - name: Rename Files + id: process_files + shell: bash + run: | + INPUT_DIR=${{ inputs.input_dir }} + NAMES=$(echo "${{ inputs.names }}" | awk NF) + FILENAME_OLD=$(echo "${{ inputs.filename_old }}" | awk NF) + FILENAME_NEW=$(echo "${{ inputs.filename_new }}" | awk NF) + + echo "## Listing Input Directory Contents" >> $GITHUB_STEP_SUMMARY + ls -la "$INPUT_DIR" >> $GITHUB_STEP_SUMMARY + + # Initialize array to store renamed file paths + RENAMED_FILES=() + + # Process each entry in the arrays + paste <(echo "$NAMES") <(echo "$FILENAME_OLD") <(echo "$FILENAME_NEW") | while IFS=$'\t' read -r NAME OLD NEW; do + SOURCE_DIR="$INPUT_DIR/$NAME" + if [ ! -d "$SOURCE_DIR" ]; then + echo "Error: Directory $SOURCE_DIR does not exist. Skipping." >> $GITHUB_STEP_SUMMARY + continue + fi + + SOURCE_FILE="$SOURCE_DIR/$OLD" + DEST_FILE="$SOURCE_DIR/$NEW" + + if [ ! -f "$SOURCE_FILE" ]; then + echo "Error: File $SOURCE_FILE does not exist. Skipping." >> $GITHUB_STEP_SUMMARY + continue + fi + + mv "$SOURCE_FILE" "$DEST_FILE" + echo "## Listing Directory Contents After Rename" >> $GITHUB_STEP_SUMMARY + ls -la "$SOURCE_DIR" >> $GITHUB_STEP_SUMMARY + if [ $? -eq 0 ]; then + echo "Successfully renamed $SOURCE_FILE to $DEST_FILE" >> $GITHUB_STEP_SUMMARY + RENAMED_FILES+=("$DEST_FILE") + else + echo "Error: Failed to rename $SOURCE_FILE to $DEST_FILE" >> $GITHUB_STEP_SUMMARY + fi + done + + # Convert renamed files array to JSON and set output + echo "Renamed files: ${RENAMED_FILES[@]}" >> $GITHUB_STEP_SUMMARY + echo "renamed_files=$(echo "${RENAMED_FILES[@]}" | jq -c -R 'split(" ")')" >> $GITHUB_OUTPUT diff --git a/.github/workflows/deploy_all.yml b/.github/workflows/deploy_all.yml index 431e29e..950c098 100644 --- a/.github/workflows/deploy_all.yml +++ b/.github/workflows/deploy_all.yml @@ -79,4 +79,5 @@ jobs: secrets: inherit with: build_sha: ${{ inputs.build_sha }} - runner_id: ${{ inputs.runner_id }} \ No newline at end of file + runner_id: ${{ inputs.runner_id }} + version_string: ${{ inputs.new_version }} \ No newline at end of file diff --git a/.github/workflows/editor_deploy.yml b/.github/workflows/editor_deploy.yml index 3297415..7f9a74d 100644 --- a/.github/workflows/editor_deploy.yml +++ b/.github/workflows/editor_deploy.yml @@ -10,22 +10,271 @@ on: description: "Runner ID of the Parent Runner" required: true type: string + new_version: + description: "New Version that'll be Deployed" + required: true + type: string # Global Settings env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: blazium-dev + BASE_NAME: BlaziumEditor_v${{ inputs.new_version }} concurrency: group: ci-${{github.actor}}-${{ github.event.client_payload.type || 'nightly' }}-editor-deploy cancel-in-progress: true jobs: - build-monoglue: + deploy-editors: runs-on: "ubuntu-20.04" - name: Example for Editor Deploy + name: Editor Deploy steps: - name: Checkout Repository uses: actions/checkout@v4 with: repository: blazium-engine/ci_cd - submodules: recursive \ No newline at end of file + submodules: recursive + + - name: Download All Template Files + uses: ./.github/actions/cerebro-download-multi-build + with: + names: | + linux-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + web-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-mono-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }}-meta + run_id: ${{ inputs.runner_id }} + cerebro_url: ${{ secrets.CEREBRO_URL }} + cerebro_auth: ${{ secrets.BLAZIUM_AUTH }} + folder: ${{ github.workspace }}/downloads + + - name: Uncompress Templates + uses: ./.github/actions/multi-uncompress-tar-gz + with: + names: | + linux-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + web-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-mono-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }}-meta + input_dir: ${{ github.workspace }}/downloads + output_dir: ${{ github.workspace }}/extracted + + - name: Edit Editor Filenames in-Place + uses: ./.github/actions/multi-rename-inplace + with: + names: | + linux-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + web-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-mono-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }}-meta + android-editor-${{ github.event.client_payload.type || 'nightly' }}-meta + filename_old: | + blazium.linuxbsd.editor.x86_64 + blazium.linuxbsd.editor.x86_64.mono + blazium.linuxbsd.editor.x86_32.mono + blazium.linuxbsd.editor.x86_32 + blazium.windows.editor.x86_64.mono.exe + blazium.windows.editor.x86_64.mono.console.exe + blazium.windows.editor.x86_64.exe + blazium.windows.editor.x86_64.console.exe + blazium.windows.editor.x86_32.mono.exe + blazium.windows.editor.x86_32.mono.console.exe + blazium.windows.editor.x86_32.exe + blazium.windows.editor.x86_32.console.exe + blazium.web.editor.wasm32.zip + Blazium_macos.universal.zip + Blazium_macos.universal.zip + android_editor-android-debug.aab + android_editor-android-debug.apk + android_editor-horizonos-debug.aab + android_editor-horizonos-debug.apk + filename_new: | + ${{ env.BASE_NAME }}_linux.x86_64 + ${{ env.BASE_NAME }}_linux.mono.x86_64 + ${{ env.BASE_NAME }}_linux.mono.x86_32 + ${{ env.BASE_NAME }}_linux.x86_32 + ${{ env.BASE_NAME }}_windows.mono.64bit.exe + ${{ env.BASE_NAME }}_windows_console.mono.64bit.exe + ${{ env.BASE_NAME }}_windows.64bit.exe + ${{ env.BASE_NAME }}_windows_console.64bit.exe + ${{ env.BASE_NAME }}_windows.mono.32bit.exe + ${{ env.BASE_NAME }}_windows_console.mono.32bit.exe + ${{ env.BASE_NAME }}_windows.32bit.exe + ${{ env.BASE_NAME }}_windows_console.32bit.exe + ${{ env.BASE_NAME }}_web.wasm32.zip + ${{ env.BASE_NAME }}_macos.universal.zip + ${{ env.BASE_NAME }}_macos.universal.mono.zip + ${{ env.BASE_NAME }}_android.aab + ${{ env.BASE_NAME }}_android.apk + ${{ env.BASE_NAME }}_android.meta.aab + ${{ env.BASE_NAME }}_android.meta.apk + input_dir: ${{ github.workspace }}/extracted + + - name: Rename Folders then Zip/Move Folders + uses: ./.github/actions/multi-folder-zip + with: + names: | + linux-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + linux-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-64bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-mono-32bit-${{ github.event.client_payload.type || 'nightly' }} + windows-editor-32bit-${{ github.event.client_payload.type || 'nightly' }} + web-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-${{ github.event.client_payload.type || 'nightly' }} + macos-editor-mono-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }} + android-editor-${{ github.event.client_payload.type || 'nightly' }}-meta + filename_new: | + ${{ env.BASE_NAME }}_linux.x86_64.zip + ${{ env.BASE_NAME }}_linux.mono.x86_64.zip + ${{ env.BASE_NAME }}_linux.mono.x86_32.zip + ${{ env.BASE_NAME }}_linux.x86_32.zip + ${{ env.BASE_NAME }}_windows.mono.64bit.zip + ${{ env.BASE_NAME }}_windows.64bit.zip + ${{ env.BASE_NAME }}_windows.mono.32bit.zip + ${{ env.BASE_NAME }}_windows.32bit.zip + ${{ env.BASE_NAME }}_web.zip + ${{ env.BASE_NAME }}_macos.zip + ${{ env.BASE_NAME }}_macos.mono.zip + ${{ env.BASE_NAME }}_android.zip + ${{ env.BASE_NAME }}_android.meta.zip + input_dir: ${{ github.workspace }}/extracted + output_dir: ${{ github.workspace }}/editors + + - name: Generate Checksums for Editors + uses: ./.github/actions/checksum-txt-generator + with: + directory: ${{ github.workspace }}/editors + + - name: Generate JSON with File Info and Checksums + shell: bash + env: + BASE_NAME: ${{ env.BASE_NAME }} + URL_BASE: ${{ secrets.CDN_URL }}/${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }} + run: | + # Define the editors directory and output file + EDITORS_DIR="${GITHUB_WORKSPACE}/editors" + OUTPUT_FILE="${EDITORS_DIR}/editors.json" + + # Ensure the directory exists + if [ ! -d "$EDITORS_DIR" ]; then + echo "Error: Directory $EDITORS_DIR does not exist." + exit 1 + fi + + # Initialize JSON array + JSON_ARRAY="[]" + + # List of files to process + FILE_NAMES=( + "${BASE_NAME}_linux.x86_64.zip" + "${BASE_NAME}_linux.mono.x86_64.zip" + "${BASE_NAME}_linux.mono.x86_32.zip" + "${BASE_NAME}_linux.x86_32.zip" + "${BASE_NAME}_windows.mono.64bit.zip" + "${BASE_NAME}_windows.64bit.zip" + "${BASE_NAME}_windows.mono.32bit.zip" + "${BASE_NAME}_windows.32bit.zip" + "${BASE_NAME}_web.zip" + "${BASE_NAME}_macos.zip" + "${BASE_NAME}_macos.mono.zip" + "${BASE_NAME}_android.zip" + "${BASE_NAME}_android.meta.zip" + ) + + # Process each file + for FILE_NAME in "${FILE_NAMES[@]}"; do + FILE_PATH="${EDITORS_DIR}/${FILE_NAME}" + + if [ -f "$FILE_PATH" ]; then + # Compute file details + FILE_SHA512=$(sha512sum "$FILE_PATH" | awk '{print $1}') + FILE_SHA256=$(sha256sum "$FILE_PATH" | awk '{print $1}') + FILE_SIZE=$(stat -c%s "$FILE_PATH") + FILE_TIMESTAMP=$(date -r "$FILE_PATH" +"%Y-%m-%dT%H:%M:%SZ") + + # Append details to JSON array + JSON_ARRAY=$(echo "$JSON_ARRAY" | jq \ + --arg name "$FILE_NAME" \ + --arg sha512 "$FILE_SHA512" \ + --arg sha256 "$FILE_SHA256" \ + --arg size "$FILE_SIZE" \ + --arg timestamp "$FILE_TIMESTAMP" \ + '. + [{ + "filename": $name, + "sha512": $sha512, + "sha256": $sha256, + "size": ($size | tonumber), + "timestamp": $timestamp + }]' + ) + else + echo "Warning: File $FILE_PATH does not exist. Skipping." >> $GITHUB_STEP_SUMMARY + fi + done + + # Save JSON array to file + echo "$JSON_ARRAY" > "$OUTPUT_FILE" + + # Log the generated JSON + echo "Generated JSON file: $OUTPUT_FILE" >> $GITHUB_STEP_SUMMARY + echo "Contents:" >> $GITHUB_STEP_SUMMARY + cat "$OUTPUT_FILE" >> $GITHUB_STEP_SUMMARY + + - uses: ./.github/actions/multi-do-upload + with: + files: | + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_linux.x86_64.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_linux.mono.x86_64.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_linux.mono.x86_32.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_linux.x86_32.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_windows.mono.64bit.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_windows.64bit.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_windows.mono.32bit.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_windows.32bit.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_web.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_macos.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_macos.mono.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_android.zip + ${{ github.workspace }}/editors/${{ env.BASE_NAME }}_android.meta.zip + ${{ github.workspace }}/editors/editors.json + space_name: ${{ secrets.DO_SPACE_NAME }} + space_region: ${{ secrets.DO_SPACE_REGION }} + access_key: ${{ secrets.DO_ACCESS_KEY }} + secret_key: ${{ secrets.DO_SECRET_KEY }} + space_path: ${{ github.event.client_payload.type || 'nightly' }}/${{ inputs.new_version }} diff --git a/.github/workflows/old/manual_build_tester.yml b/.github/workflows/old/manual_build_tester.yml new file mode 100644 index 0000000..1b87316 --- /dev/null +++ b/.github/workflows/old/manual_build_tester.yml @@ -0,0 +1,33 @@ +on: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + type: choice + options: + - info + - warning + - debug + tags: + description: 'Test scenario tags' + required: false + type: boolean + environment: + description: 'Environment to run tests against' + type: environment + required: true + +jobs: + log-the-inputs: + runs-on: ubuntu-latest + steps: + - run: | + echo "Log level: $LEVEL" + echo "Tags: $TAGS" + echo "Environment: $ENVIRONMENT" + env: + LEVEL: ${{ inputs.logLevel }} + TAGS: ${{ inputs.tags }} + ENVIRONMENT: ${{ inputs.environment }} \ No newline at end of file diff --git a/.github/workflows/old/windows_builds.old.yml b/.github/workflows/old/windows_builds.old.yml new file mode 100644 index 0000000..0f65413 --- /dev/null +++ b/.github/workflows/old/windows_builds.old.yml @@ -0,0 +1,235 @@ +name: 🏁 Windows Builds +on: + workflow_call: + inputs: + build_sha: + description: "Build commit SHA to use for this job" + required: true + type: string + runner_id: + description: "Runner ID of the Parent Runner" + required: true + type: string + new_major: + description: "New Major # for Version" + required: true + type: string + new_minor: + description: "New Minor # for Version" + required: true + type: string + new_patch: + description: "New Patch # for Version" + required: true + type: string + new_version: + description: "New Version that'll be Deployed" + required: true + type: string + +# Global Settings +# SCONS_CACHE for windows must be set in the build environment +env: + # Used for the cache key. Add version suffix to force clean build. + GODOT_BASE_BRANCH: blazium-dev + SCONSFLAGS: verbose=yes warnings=no werror=no debug_symbols=no progress=no module_text_server_fb_enabled=yes d3d12=yes "mesa_libs=${{github.workspace}}/deps/mesa" "angle_libs=${{github.workspace}}/deps/angle" + SCONS_CACHE_MSVC_CONFIG: true + DEPLOY_TYPE: windows + +concurrency: + group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows + cancel-in-progress: true + +jobs: + build-windows: + # Windows 10 with latest image + runs-on: "windows-latest" + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - name: Editor (target=editor, tests=yes) + cache-name: windows-editor + target: editor + sconsflags: ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: false + + - name: Editor w/ Mono (target=editor) + cache-name: windows-editor-mono + target: editor + sconsflags: module_mono_enabled=yes ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: true + + - name: Template (target=template_release) + cache-name: windows-template + target: template_release + sconsflags: ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: false + + - name: Template (target=template_debug) + cache-name: windows-template-debug + target: template_debug + sconsflags: ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: false + + - name: Template (target=template_release) + cache-name: windows-template + target: template_release + sconsflags: ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: true + + - name: Template (target=template_debug) + cache-name: windows-template-debug + target: template_debug + sconsflags: ${{ github.event.client_payload.production && 'production=yes' || 'dev_build=yes' }} + mono: true + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + repository: blazium-engine/blazium + ref: ${{ inputs.build_sha }} + submodules: recursive + fetch-depth: 2 + + - name: Remove existing workflows folder + run: | + rm -rf .github/workflows + + - name: Pull .github folder from ci_cd repository + run: | + git clone --depth=1 https://github.com/blazium-engine/ci_cd.git ci_cd_repo + cp -r ci_cd_repo/.github/* .github/ + rm -rf ci_cd_repo + + - name: Notify Cerebro of Build Starting + uses: ./.github/actions/cerebro-started + with: + name: ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }} + run_id: ${{ inputs.runner_id }} + cerebro_url: ${{ secrets.CEREBRO_URL }} + cerebro_auth: ${{ secrets.BLAZIUM_AUTH }} + build_type: ${{ startsWith(matrix.target, 'template_') && 'template' || 'editor' }} + mono: ${{ matrix.mono }} + deploy_type: ${{ github.event.client_payload.type || 'nightly' }} + branch: ${{ github.event.client_payload.branch }} + build_os: windows + checksum: ${{ inputs.build_sha }} + production: ${{ github.event.client_payload.production }} + + + - name: Restore Godot build cache + uses: ./.github/actions/godot-cache-restore + with: + cache-name: ${{ matrix.cache-name }} + continue-on-error: true + + - name: Setup Python and SCons + uses: ./.github/actions/godot-deps + + - name: Download ANGLE Libraries + uses: ./.github/actions/download-angle-action + with: + angle_url_base: "https://github.com/godotengine/godot-angle-static/releases/download/chromium%2F6601.2/godot-angle-static" + angle_folder: "${{ github.workspace }}/deps/angle" + + - name: Download Mesa Libraries + uses: ./.github/actions/download-mesa-action + with: + mesa_url_base: "https://github.com/godotengine/godot-nir-static/releases/download/23.1.9-1/godot-nir-static" + mesa_folder: "${{ github.workspace }}/deps/mesa" + + - name: Download pre-built ANGLE static libraries + uses: dsaltares/fetch-gh-release-asset@1.1.2 + with: + repo: godotengine/godot-angle-static + version: tags/chromium/6601.2 + file: godot-angle-static-x86_64-${{ matrix.compiler == 'gcc' && 'gcc' || 'msvc' }}-release.zip + target: angle/angle.zip + + - name: Extract pre-built ANGLE static libraries + run: Expand-Archive -Force angle/angle.zip ${{github.workspace}}/ + + - name: Setup MSVC problem matcher + if: matrix.compiler == 'msvc' + uses: ammaraskar/msvc-problem-matcher@master + + - name: Setup GCC problem matcher + if: matrix.compiler != 'msvc' + uses: ammaraskar/gcc-problem-matcher@master + + - name: Compilation + uses: ./.github/actions/godot-build + with: + sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} + platform: windows + target: ${{ matrix.target }} + tests: ${{ matrix.tests }} + + - name: Download and extract mono-glue + if: matrix.mono + run: | + TYPE=${{ github.event.client_payload.type || 'nightly' }} + URL="https://cdn.blazium.app/${TYPE}/monoglue/monoglue-${TYPE}.tar.gz" + + # Download the file + curl -L $URL -o monoglue.tar.gz + + # Create target directories if they don't exist + mkdir -p modules/mono/glue/GodotSharp/GodotSharp + mkdir -p modules/mono/glue/GodotSharp/GodotSharpEditor + + # Extract the specific directories from the tar.gz file to their target locations + tar -xzvf monoglue.tar.gz --strip-components=1 -C modules/mono/glue/GodotSharp/GodotSharp GodotSharp + tar -xzvf monoglue.tar.gz --strip-components=1 -C modules/mono/glue/GodotSharp/GodotSharpEditor GodotSharpEditor + + - name: Build GodotSharp + if: matrix.mono + run: python modules/mono/build_scripts/build_assemblies.py --godot-output-dir=./bin + + - name: Save Godot build cache + uses: ./.github/actions/godot-cache-save + with: + cache-name: ${{ matrix.cache-name }} + continue-on-error: true + + - name: Create tar.gz Archive + run: | + tar -czvf ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }}.tar.gz -C ./bin . + + - uses: BetaHuhn/do-spaces-action@v2 + with: + access_key: ${{ secrets.DO_ACCESS_KEY }} + secret_key: ${{ secrets.DO_SECRET_KEY }} + space_name: ${{ secrets.DO_SPACE_NAME }} + space_region: ${{ secrets.DO_SPACE_REGION }} + source: ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }}.tar.gz + out_dir: ${{ env.DEPLOY_TYPE }}/${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }}${{ startsWith(matrix.target, 'template_') && '/template' || '' }} + + + - name: Upload artifact + uses: ./.github/actions/upload-artifact + with: + name: ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }} + + - name: Notify Cerebro of Build Success + if: success() # Only runs if the job was successful + uses: ./.github/actions/cerebro-completed + with: + name: ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }} + run_id: ${{ inputs.runner_id }} + file_url: ${{ secrets.CDN_URL }}/${{ env.DEPLOY_TYPE }}/${{ github.event.client_payload.type || 'nightly' }}${{ startsWith(matrix.target, 'template_') && '/template' || '' }}/${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }}.tar.gz + version: "" + cerebro_url: ${{ secrets.CEREBRO_URL }} + cerebro_auth: ${{ secrets.BLAZIUM_AUTH }} + + - name: Notify Cerebro of Build Failure + if: failure() || cancelled() # Triggers if the job fails or is canceled + uses: ./.github/actions/cerebro-failed + with: + name: ${{ matrix.cache-name }}-${{ github.event.client_payload.type || 'nightly' }} + run_id: ${{ inputs.runner_id }} + cerebro_url: ${{ secrets.CEREBRO_URL }} + cerebro_auth: ${{ secrets.BLAZIUM_AUTH }} \ No newline at end of file