Fixed artifact naming & collect all at dedicated release folder

This commit is contained in:
Thorsten Sommer 2024-06-21 19:08:27 +02:00
parent 8a3bdbb0b5
commit b45f10e246
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -584,8 +584,8 @@ jobs:
echo "${changelog}" >> "$GITHUB_OUTPUT" echo "${changelog}" >> "$GITHUB_OUTPUT"
echo "EOOOF" >> "$GITHUB_OUTPUT" echo "EOOOF" >> "$GITHUB_OUTPUT"
create_update_file: create_release:
name: Create Tauri update file name: Prepare and create the final release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build_main, read_metadata] # TODO: build_linux_arm64 needs: [build_main, read_metadata] # TODO: build_linux_arm64
steps: steps:
@ -600,11 +600,39 @@ jobs:
- name: Display structure of downloaded files - name: Display structure of downloaded files
run: ls -Rlhat $GITHUB_WORKSPACE/artifacts run: ls -Rlhat $GITHUB_WORKSPACE/artifacts
- name: Prepare release assets
env:
FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }}
run: |
RELEASE_DIR="$GITHUB_WORKSPACE/release/assets"
# Ensure the release directory exists:
mkdir -p "$RELEASE_DIR"
# Find and process files in the artifacts directory:
find "$GITHUB_WORKSPACE/artifacts" -type f | while read -r FILE; do
if [[ "$FILE" == *"x86_64-apple-darwin"* && "$FILE" == *".tar.gz" ]]; then
TARGET_NAME="MindWork AI Studio_${FORMATTED_VERSION}_x64.app.tar.gz"
elif [[ "$FILE" == *"x86_64-apple-darwin"* && "$FILE" == *".tar.gz.sig" ]]; then
TARGET_NAME="MindWork AI Studio_${FORMATTED_VERSION}_x64.app.tar.gz.sig"
elif [[ "$FILE" == *"aarch64-apple-darwin"* && "$FILE" == *".tar.gz" ]]; then
TARGET_NAME="MindWork AI Studio_${FORMATTED_VERSION}_aarch64.app.tar.gz"
elif [[ "$FILE" == *"aarch64-apple-darwin"* && "$FILE" == *".tar.gz.sig" ]]; then
TARGET_NAME="MindWork AI Studio_${FORMATTED_VERSION}_aarch64.app.tar.gz.sig"
else
TARGET_NAME="$(basename "$FILE")"
fi
cp "$FILE" "${RELEASE_DIR}/${TARGET_NAME}"
done
- name: Create .update directory - name: Create .update directory
run: mkdir -p $GITHUB_WORKSPACE/.updates run: mkdir -p $GITHUB_WORKSPACE/.updates
- name: Build platform JSON - name: Build platform JSON for latest.json file
env: env:
FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }} FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }}
@ -650,7 +678,7 @@ jobs:
else else
echo " Error: Could not find the platform file for the signature file '$sig_file'." echo " Error: Could not find the platform file for the signature file '$sig_file'."
fi fi
done < <(find $GITHUB_WORKSPACE/artifacts -type f -name '*.sig' -print0) done < <(find $GITHUB_WORKSPACE/release/assets -type f -name '*.sig' -print0)
# Write the JSON object to a temporary file: # Write the JSON object to a temporary file:
echo "$platforms_json" > $GITHUB_WORKSPACE/.updates/platforms.json echo "$platforms_json" > $GITHUB_WORKSPACE/.updates/platforms.json
@ -661,10 +689,7 @@ jobs:
FORMATTED_BUILD_TIME: ${{ needs.read_metadata.outputs.formatted_build_time }} FORMATTED_BUILD_TIME: ${{ needs.read_metadata.outputs.formatted_build_time }}
CHANGELOG: ${{ needs.read_metadata.outputs.changelog }} CHANGELOG: ${{ needs.read_metadata.outputs.changelog }}
run: | run: |
# Remove the latest.json file if it exists:
rm -f $GITHUB_WORKSPACE/.updates/latest.json
# Read the platforms JSON, which was created in the previous step: # Read the platforms JSON, which was created in the previous step:
platforms=$(cat $GITHUB_WORKSPACE/.updates/platforms.json) platforms=$(cat $GITHUB_WORKSPACE/.updates/platforms.json)
@ -672,7 +697,7 @@ jobs:
changelog=$(echo "$CHANGELOG" | awk '{printf "%s\\n", $0}') changelog=$(echo "$CHANGELOG" | awk '{printf "%s\\n", $0}')
# Create the latest.json file: # Create the latest.json file:
cat <<EOOOF > $GITHUB_WORKSPACE/.updates/latest.json cat <<EOOOF > $GITHUB_WORKSPACE/release/assets/latest.json
{ {
"version": "$FORMATTED_VERSION", "version": "$FORMATTED_VERSION",
"notes": "$changelog", "notes": "$changelog",
@ -681,5 +706,8 @@ jobs:
} }
EOOOF EOOOF
- name: Show all release assets
run: ls -Rlhat $GITHUB_WORKSPACE/release/assets
- name: Display the content of latest.json - name: Display the content of latest.json
run: cat $GITHUB_WORKSPACE/.updates/latest.json run: cat $GITHUB_WORKSPACE/release/assets/latest.json