From 6d589339fb5c96577d073b65955b141c95afe9f8 Mon Sep 17 00:00:00 2001 From: Efra Espada Date: Sat, 9 Nov 2024 01:03:00 +0100 Subject: [PATCH] feature: updated version and workflows --- .github/workflows/push_checks_windows.yml | 190 ++++++++++++---------- 1 file changed, 104 insertions(+), 86 deletions(-) diff --git a/.github/workflows/push_checks_windows.yml b/.github/workflows/push_checks_windows.yml index 56fb1d5..4ce6493 100644 --- a/.github/workflows/push_checks_windows.yml +++ b/.github/workflows/push_checks_windows.yml @@ -49,40 +49,47 @@ jobs: run: flutter analyze - name: Handle job completion - shell: cmd if: always() + shell: cmd + env: + CHAT_ID: ${{ secrets.CHAT_ID }} + CHAT_KEY: ${{ secrets.CHAT_KEY }} + REPO: ${{ github.repository }} + VERSION: ${{ env.VERSION }} + JOB_STATUS: ${{ job.status }} run: | - if [ "${{ job.status }}" == "failure" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🔴 Analyze - Windows Failed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + echo The VERSION is: %VERSION% + if "%JOB_STATUS%" == "failure" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🔴 Analyze - Windows Failed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - elif [ "${{ job.status }}" == "cancelled" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟠 Analyze - Windows Canceled" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else if "%JOB_STATUS%" == "cancelled" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟠 Analyze - Windows Canceled" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - else - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟢 Analyze - Windows Passed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟢 Analyze - Windows Passed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - fi + ) check_windows_test: name: Test Windows runs-on: [self-hosted, Windows] @@ -119,39 +126,44 @@ jobs: - name: Handle job completion if: always() shell: cmd + env: + CHAT_ID: ${{ secrets.CHAT_ID }} + CHAT_KEY: ${{ secrets.CHAT_KEY }} + REPO: ${{ github.repository }} + VERSION: ${{ env.VERSION }} + JOB_STATUS: ${{ job.status }} run: | - if [ "${{ job.status }}" == "failure" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🔴 Test - Windows Failed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + if "%JOB_STATUS%" == "failure" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🔴 Test - Windows Failed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - elif [ "${{ job.status }}" == "cancelled" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟠 Test - Windows Canceled" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else if "%JOB_STATUS%" == "cancelled" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟠 Test - Windows Canceled" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - else - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟢 Test - Windows Passed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟢 Test - Windows Passed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - fi - + ) check_windows_publish_dry_run: name: Dry Run Publish Windows runs-on: [self-hosted, Windows] @@ -188,35 +200,41 @@ jobs: - name: Handle job completion if: always() shell: cmd + env: + CHAT_ID: ${{ secrets.CHAT_ID }} + CHAT_KEY: ${{ secrets.CHAT_KEY }} + REPO: ${{ github.repository }} + VERSION: ${{ env.VERSION }} + JOB_STATUS: ${{ job.status }} run: | - if [ "${{ job.status }}" == "failure" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🔴 Dry Run Publish - Windows Failed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + if "%JOB_STATUS%" == "failure" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🔴 Dry Run Publish - Windows Failed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - elif [ "${{ job.status }}" == "cancelled" ]; then - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟠 Dry Run Publish - Windows Canceled" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else if "%JOB_STATUS%" == "cancelled" ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟠 Dry Run Publish - Windows Canceled" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - else - landa-messenger-api chat-send \ - --id "${{ secrets.CHAT_ID }}" \ - --api_key "${{ secrets.CHAT_KEY }}" \ - --title "🟢 Dry Run Publish - Windows Passed" \ - --body "${{ github.repository }}: v${{ env.VERSION }}" \ - --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" \ - --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" \ - --background_color "#55000000" \ + ) else ( + landa-messenger-api chat-send ^ + --id "%CHAT_ID%" ^ + --api_key "%CHAT_KEY%" ^ + --title "🟢 Dry Run Publish - Windows Passed" ^ + --body "%REPO%: v%VERSION%" ^ + --url "https://github.com/landamessenger/zstandard/actions/workflows/tag_version_and_publish.yml" ^ + --image "https://avatars.githubusercontent.com/u/63705403?s=200&v=4" ^ + --background_color "#55000000" ^ --text_color "#FFFFFFFF" - fi + ) \ No newline at end of file