diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index c26fe02..9b4bdc8 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -46,13 +46,30 @@ jobs: cd .. bash build.sh --release cd build - artifact_name=$(basename meta-*.zip .zip) - echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV + artifact_name=$(basename meta-*release.zip .zip) unzip "$artifact_name".zip - rm "$artifact_name".zip *.json + mv "$artifact_name".zip "${artifact_name/release/ci}".zip + echo "ARTIFACT_NAME=${artifact_name/release/ci}" >> $GITHUB_ENV + + - name: Notify Telegram + env: + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + TAG_NAME=${GITHUB_REF##*/} + CAPTION="*CI ${TAG_NAME}*" + RELEASE_FILE=$(find build -maxdepth 1 -type f -name "meta*ci.zip") + + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \ + -F chat_id="${TELEGRAM_CHAT_ID}" \ + -F parse_mode="Markdown" \ + -F caption="$CAPTION" \ + -F document=@"${RELEASE_FILE}" + + rm build/{*.zip,*.json,*.md} - name: Upload artifact uses: actions/upload-artifact@v5 with: - name: ci-${{ env.ARTIFACT_NAME }} + name: ${{ env.ARTIFACT_NAME }} path: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b03a33..d65fb27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 with: - draft: true + body_path: build/changelog.md files: | build/*.zip @@ -66,5 +66,21 @@ jobs: cat build/update.json > update.json cat build/changelog.md > changelog.md git add update.json changelog.md - git commit -m "[skip ci] Update build json files" + git commit -m "[skip ci] Update build files" git push origin public + + - name: Notify Telegram + env: + TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }} + TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }} + run: | + TAG_NAME=${GITHUB_REF##*/} + CAPTION="*Release ${TAG_NAME}*" + RELEASE_FILE=$(find build -maxdepth 1 -type f -name "meta*release.zip") + + curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendDocument" \ + -F chat_id="${TELEGRAM_CHAT_ID}" \ + -F parse_mode="Markdown" \ + -F caption="$CAPTION" \ + -F document=@"${RELEASE_FILE}" +