From 78658665c7d4d65c1b329219b15cb628cc87a243 Mon Sep 17 00:00:00 2001 From: CoolCoderCarl <123qwekir2wl@gmail.com> Date: Sat, 21 May 2022 02:15:59 +0300 Subject: [PATCH] Update CI & changelog.json --- .github/workflows/build.yaml | 6 ++-- .github/workflows/release.yaml | 62 +++++++++++++++++++++++++++------- changelog.json | 8 +++-- 3 files changed, 59 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 20a1186..eb1366a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -26,12 +26,13 @@ jobs: with: github_token: ${{ secrets.REPOS_TOKEN }} - - name: Add label + - name: Set label develop uses: actions-ecosystem/action-add-labels@v1 with: labels: develop - - uses: actions-ecosystem/action-add-assignees@v1 + - name: Add author as assignees + uses: actions-ecosystem/action-add-assignees@v1 with: assignees: ${{ github.actor }} github_token: ${{ secrets.REPOS_TOKEN }} @@ -55,6 +56,7 @@ jobs: build: name: Build packages runs-on: ${{ matrix.os }} + needs: prepare strategy: matrix: include: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f95b41..59cf7b8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,11 +10,10 @@ on: jobs: - release: - name: Create Release + prepare: + name: Prepare env & label runs-on: ubuntu-latest outputs: - get_release_url: ${{ steps.set_release_url.outputs.release_url }} get_current_tag: ${{ steps.set_current_tag_id.outputs.current_tag }} steps: @@ -27,6 +26,44 @@ jobs: with: github_token: ${{ secrets.REPOS_TOKEN }} + - name: Set label release + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: release + + - name: Add author as assignees + uses: actions-ecosystem/action-add-assignees@v1 + with: + assignees: ${{ github.actor }} + github_token: ${{ secrets.REPOS_TOKEN }} + + - name: Set tag version to output + id: set_current_tag_id + run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}" + + - name: Notify if failure + if: ${{ failure() }} + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_CHAT }} + token: ${{ secrets.TELEGRAM_TOKEN }} + format: html + message: | + !!! FAILED !!! + Failed job: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} + + release: + name: Create Release + runs-on: ubuntu-latest + needs: prepare + outputs: + get_release_url: ${{ steps.set_release_url.outputs.release_url }} + steps: + + - name: Checkout code + uses: actions/checkout@v2 + - name: Build Changelog id: github_release uses: mikepenz/release-changelog-builder-action@v3 @@ -41,18 +78,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.REPOS_TOKEN }} with: - tag_name: ${{ steps.tag_version.outputs.new_tag }} - release_name: Release ${{ steps.tag_version.outputs.new_tag }} + tag_name: ${{ needs.prepare.outputs.get_current_tag }} + release_name: Release ${{ needs.prepare.outputs.get_current_tag }} body: ${{ steps.github_release.outputs.changelog }} - name: Set Release URL id: set_release_url run: echo "::set-output name=release_url::${{ steps.create_release.outputs.upload_url }}" - - name: Set tag version to output - id: set_current_tag_id - run: echo "::set-output name=current_tag::${{ steps.tag_version.outputs.new_tag }}" - - name: Notify if failure if: ${{ failure() }} uses: appleboy/telegram-action@master @@ -68,7 +101,7 @@ jobs: build: name: Build packages - needs: release + needs: [ prepare, release ] runs-on: ${{ matrix.os }} strategy: matrix: @@ -85,7 +118,10 @@ jobs: ASSET_MIME: application/x-binary steps: - - uses: actions/checkout@v2 + + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up Python 3.9 uses: actions/setup-python@v2 with: @@ -133,7 +169,7 @@ jobs: telegram: runs-on: ubuntu-latest name: Notification - needs: [ release, build ] + needs: [ prepare, release, build ] steps: - name: Notify telegram message after Released @@ -153,6 +189,6 @@ jobs: Branch: ${{ github.ref }} - Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ needs.release.outputs.get_current_tag }} + Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.get_current_tag }} See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} diff --git a/changelog.json b/changelog.json index 50742c4..f07dc08 100644 --- a/changelog.json +++ b/changelog.json @@ -1,8 +1,12 @@ { "categories": [ { - "title": "## 🚀 Features", + "title": "## Features", "labels": ["develop"] + }, + { + "title": "## Release", + "labels": ["release"] } ] -} +} \ No newline at end of file