Browse Source

Update autodeploy.yml

Morozov Vadim 4 months ago
parent
commit
15c8f53308
1 changed files with 27 additions and 27 deletions
  1. 27 27
      .github/workflows/autodeploy.yml

+ 27 - 27
.github/workflows/autodeploy.yml

@@ -40,7 +40,7 @@ jobs:
           npx semantic-release --dry-run --no-ci | tee release.log
 
           # Extract version (now supports pre-releases like -dev.23, -beta.5, etc.)
-          NEXT_VERSION=$(grep 'The next release version is' release.log \
+          NEXT_VERSION=v$(grep 'The next release version is' release.log \
                         | sed -E 's/.* ([0-9]+\.[0-9]+\.[0-9]+[-.0-9a-zA-Z]*).*$/\1/')
           
           echo "APP_VERSION=$NEXT_VERSION" >> $GITHUB_ENV
@@ -50,7 +50,7 @@ jobs:
         run: |
           echo "Writing..."
           echo "API_URL=https://hapticx.ru/api" >> .env
-          echo "APP_VERSION=v${APP_VERSION}" >> .env
+          echo "APP_VERSION=${APP_VERSION}" >> .env
 
       - name: Build android
         run: pnpm build:mobile
@@ -69,30 +69,30 @@ jobs:
         env:
           GH_TOKEN: ${{ secrets.GH_TOKEN }}
 
-  # deploy_dev:
-  #   name: "Уведомление в Telegram 🔔"
-  #   runs-on: ubuntu-latest
-  #   needs: build
-
-  #   steps:
-  #     - uses: actions/checkout@v4
-
-  #     - name: Escape bad symbols in variables
-  #       id: escape_vars
-  #       run: |
-  #         escaped_message=$(echo "${{ github.event.head_commit.message }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
-  #         escaped_actor=$(echo "${{ github.actor }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
-  #         escaped_branch=$(echo "${{ github.ref_name }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
-  #         echo "escaped_message=$escaped_message" >> $GITHUB_ENV
-  #         echo "escaped_actor=$escaped_actor" >> $GITHUB_ENV
-  #         echo "escaped_branch=$escaped_branch" >> $GITHUB_ENV
-
-  #     - name: Send Telegram Message
-  #       run: |
-  #         curl \
-  #           --data-urlencode 'chat_id=${{ secrets.TELEGRAM_CHAT_ID }}' \
-  #           --data-urlencode 'message_thread_id=${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}' \
-  #           --data-urlencode 'link_preview_options={"url":"${{ github.event.head_commit.url }}"}' \
-  #           --data-urlencode 'parse_mode=markdownv2' \
+  telegram_notification:
+    name: "Уведомление в Telegram 🔔"
+    runs-on: ubuntu-latest
+    needs: build
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Escape bad symbols in variables
+        id: escape_vars
+        run: |
+          escaped_message=$(echo "${{ github.event.head_commit.message }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
+          escaped_actor=$(echo "${{ github.actor }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
+          escaped_branch=$(echo "${{ github.ref_name }}" | perl -pe 's/([&~\`\*\_\[\]()#\+\-\=\|\{\}\.\!])/\\\\$1/g')
+          echo "escaped_message=$escaped_message" >> $GITHUB_ENV
+          echo "escaped_actor=$escaped_actor" >> $GITHUB_ENV
+          echo "escaped_branch=$escaped_branch" >> $GITHUB_ENV
+
+      - name: Send Telegram Message
+        run: |
+          curl \
+            --data-urlencode 'chat_id=${{ secrets.TELEGRAM_CHAT_ID }}' \
+            --data-urlencode 'message_thread_id=${{ secrets.TELEGRAM_MESSAGE_THREAD_ID }}' \
+            --data-urlencode 'link_preview_options={"url":"${{ github.event.head_commit.url }}"}' \
+            --data-urlencode 'parse_mode=markdownv2' \
   #           --data-urlencode $'text=🔨 *Frontend deploy* 🔨\n\n>${{ env.escaped_message }}\n_by [${{ env.escaped_actor }}](https://github.com/${{ env.escaped_actor }})_ at `${{ env.escaped_branch }}`\n\n[commit link](${{ github.event.head_commit.url }})' \
   #           curl "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage"