From 3a27855e09accdaffeb9aa030f9f0256fdd8b765 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Fri, 5 May 2023 13:52:35 +0800 Subject: [PATCH] Update workflows --- .github/workflows/dev-latest.yml | 19 ++++++++++++++++++- .github/workflows/docker.yml | 15 +-------------- .github/workflows/release.yml | 6 +++--- .github/workflows/telegram.yml | 18 ++++++++++++++++++ 4 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/telegram.yml diff --git a/.github/workflows/dev-latest.yml b/.github/workflows/dev-latest.yml index 3206e8d3..499cbe1b 100644 --- a/.github/workflows/dev-latest.yml +++ b/.github/workflows/dev-latest.yml @@ -3,7 +3,7 @@ name: Deploy To Dockerhub(dev) on: push: tags: - - '\d+\.\d+\.\d+-beta(?:\d+)?' + - '\d+\.\d+\.\d+-beta\d+' jobs: test: @@ -56,3 +56,20 @@ jobs: estrellaxd/auto_bangumi:dev-latest estrellaxd/auto_bangumi:${{ github.ref_name }} file: Dockerfile + + generate_release: + runs-on: ubuntu-latest + needs: [test] + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Generate Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref_name }} + release_name: 🌙${{ github.ref_name }} + draft: true + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} + diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0ddefd39..fa6846ad 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -73,17 +73,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha, scope=${{ github.workflow }} - cache-to: type=gha, scope=${{ github.workflow }} - - telegram: - runs-on: ubuntu-latest - needs: [build] - steps: - - name: send telegram message on push - uses: appleboy/telegram-action@master - with: - to: ${{ secrets.TELEGRAM_TO }} - token: ${{ secrets.TELEGRAM_TOKEN }} - message: | - New release: ${{ github.event.release.title }} - Link: ${{ github.event.release.html_url }} \ No newline at end of file + cache-to: type=gha, scope=${{ github.workflow }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95e2662c..6a59ad28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,8 +14,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - name: Generate Release Draft - uses: actions/create-release@v1 + - name: Generate Release + uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.event.pull_request.title }} release_name: 🌟${{ github.event.pull_request.title }} @@ -23,4 +23,4 @@ jobs: draft: false prerelease: false env: - GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} diff --git a/.github/workflows/telegram.yml b/.github/workflows/telegram.yml new file mode 100644 index 00000000..c3a50131 --- /dev/null +++ b/.github/workflows/telegram.yml @@ -0,0 +1,18 @@ +name: Telegram Notification + +on: + release: + types: [published] + +jobs: + telegram: + runs-on: ubuntu-latest + steps: + - name: send telegram message on push + uses: appleboy/telegram-action@master + with: + to: ${{ secrets.TELEGRAM_TO }} + token: ${{ secrets.TELEGRAM_TOKEN }} + message: | + New release: ${{ github.event.release.title }} + Link: ${{ github.event.release.html_url }} \ No newline at end of file