From b9c4796a7ac8f2ebd007717b1fa486c0bde55feb Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 7 Oct 2024 20:26:29 +0200 Subject: [PATCH] Returned release notes input to release workflow (#193) --- .github/workflows/create_release.yml | 49 ++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index e784717..0ada927 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -18,12 +18,19 @@ on: description: "Version" required: true type: string + release-notes: + description: "Release notes" + required: true + type: string run-integration-tests: description: "Run integration tests" required: true type: boolean default: true +env: + RELEASE_NOTES_FILE: release_notes_en_${{ inputs.version }} + jobs: run-integration-tests: name: Run integration tests @@ -56,9 +63,24 @@ jobs: stage-backend: false version: ${{ inputs.version }} + generate-release-notes: + name: Generate release notes + needs: [build-android, build-ios] + runs-on: ubuntu-latest + steps: + - name: Generate release notes + run: | + echo ${{ inputs.release-notes }} > ${{ env.RELEASE_NOTES_FILE }}.md + perl -i -pe 's/\s{1}(-{1})/\n$1/g' ${{ env.RELEASE_NOTES_FILE }}.md + - name: Upload merged_native_libs.zip to artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ env.RELEASE_NOTES_FILE }} + path: ${{ env.RELEASE_NOTES_FILE }}.md + create-github-release: name: Create Github release - needs: [build-android, build-ios] + needs: [generate-release-notes] runs-on: ubuntu-latest permissions: contents: write @@ -70,6 +92,14 @@ jobs: - name: Increment build number & replace version number run: bash ./.github/scripts/increment_build_number.sh ${{ github.event.inputs.version }} + - name: Download release notes + uses: actions/download-artifact@v3 + with: + name: ${{ env.RELEASE_NOTES_FILE }} + + - name: Move release notes to a folder + run: mv assets/release_notes/${{ env.RELEASE_NOTES_FILE }}.md ${{ env.RELEASE_NOTES_FILE }} + - name: Commit changes run: | git config --local user.email "github-actions[bot]@users.noreply.github.com" @@ -97,11 +127,11 @@ jobs: artifacts: "m3_lightmeter.apk" skipIfReleaseExists: true tag: "v${{ github.event.inputs.version }}" - bodyFile: "assets/release_notes/release_notes_en_${{ inputs.version }}.md" + bodyFile: "${{ env.RELEASE_NOTES_FILE }}.md" create-google-play-release: name: Create Google Play release - needs: [build-android, build-ios] + needs: [generate-release-notes] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -118,11 +148,16 @@ jobs: unzip app-prod-release.aab (cd base/lib && zip -r "$OLDPWD/merged_native_libs.zip" .) + - name: Download release notes + uses: actions/download-artifact@v3 + with: + name: ${{ env.RELEASE_NOTES_FILE }} + - name: Move release notes to a folder run: | - mv assets/release_notes/release_notes_en_${{ inputs.version }}.md whatsnew-en-US + mv assets/release_notes/${{ env.RELEASE_NOTES_FILE }}.md ${{ env.RELEASE_NOTES_FILE }} mkdir whatsnew - mv whatsnew-en-US whatsnew + mv ${{ env.RELEASE_NOTES_FILE }} whatsnew # https://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match' # https://stackoverflow.com/questions/74353311/github-workflow-unable-to-process-file-command-env-successfully @@ -147,7 +182,7 @@ jobs: upload-to-app-store: name: Upload to App Store - needs: [build-android, build-ios] + needs: [generate-release-notes] runs-on: macos-13 steps: - uses: actions/checkout@v3 @@ -177,4 +212,4 @@ jobs: m3_lightmeter_apk m3_lightmeter_appbundle m3_lightmeter_ipa - whatsnew-en-US + ${{ env.RELEASE_NOTES_FILE }}