From 9110a42b197685d123b12d089010d5f372705ed6 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Tue, 18 Jun 2024 20:25:35 +0200 Subject: [PATCH] Read changelog from repo --- .github/workflows/build-and-release.yml | 27 ++++++++++++++++++++----- metadata.txt | 2 +- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 0db65bb3..e9f321b7 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -340,7 +340,7 @@ jobs: build_linux_arm64: name: Build app (linux-arm64) runs-on: ubuntu-latest - if: true # disable this job for now + if: false # disable this job for now steps: - name: Checkout repository @@ -545,6 +545,7 @@ jobs: outputs: formatted_version: ${{ steps.format_metadata.outputs.formatted_version }} formatted_build_time: ${{ steps.format_metadata.outputs.formatted_build_time }} + changelog: ${{ steps.read_changelog.outputs.changelog }} steps: - name: Checkout repository @@ -569,12 +570,24 @@ jobs: # Set the outputs: echo "formatted_version=${formatted_version}" >> "$GITHUB_OUTPUT" + echo "FORMATTED_VERSION=${formatted_version}" >> $GITHUB_ENV echo "formatted_build_time=${formatted_build_time}" >> "$GITHUB_OUTPUT" + + - name: Read changelog + id: read_changelog + run: | + # Read the changelog file: + changelog=$(cat "app/MindWork AI Studio/wwwroot/changelog/${FORMATTED_VERSION}.md") + + # Set the output: + echo "changelog<> "$GITHUB_OUTPUT" + echo "${changelog}" >> "$GITHUB_OUTPUT" + echo "EOOOF" >> "$GITHUB_OUTPUT" create_update_file: name: Create Tauri update file runs-on: ubuntu-latest - needs: [build_main, read_metadata, build_linux_arm64] # TODO: build_linux_arm64 + needs: [build_main, read_metadata] # TODO: build_linux_arm64 steps: - name: Create artifact directory run: mkdir -p $GITHUB_WORKSPACE/artifacts @@ -646,6 +659,7 @@ jobs: env: FORMATTED_VERSION: ${{ needs.read_metadata.outputs.formatted_version }} FORMATTED_BUILD_TIME: ${{ needs.read_metadata.outputs.formatted_build_time }} + CHANGELOG: ${{ needs.read_metadata.outputs.changelog }} run: | # Remove the latest.json file if it exists: @@ -654,15 +668,18 @@ jobs: # Read the platforms JSON, which was created in the previous step: platforms=$(cat $GITHUB_WORKSPACE/.updates/platforms.json) + # Replace newlines in changelog with \n + changelog=$(echo "$CHANGELOG" | awk '{printf "%s\\n", $0}') + # Create the latest.json file: - cat < $GITHUB_WORKSPACE/.updates/latest.json + cat < $GITHUB_WORKSPACE/.updates/latest.json { "version": "$FORMATTED_VERSION", - "notes": "Update to version $FORMATTED_VERSION.", + "notes": "$changelog", "pub_date": "$FORMATTED_BUILD_TIME", "platforms": $platforms } - EOF + EOOOF - name: Display the content of latest.json run: cat $GITHUB_WORKSPACE/.updates/latest.json \ No newline at end of file diff --git a/metadata.txt b/metadata.txt index 0d758ac5..b7d7d69a 100644 --- a/metadata.txt +++ b/metadata.txt @@ -1,4 +1,4 @@ -0.5.2 +0.5.0 2024-06-17 10:47:38 UTC 153 8.0.206 (commit bb12410699)