Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Merge 7865866 into 5a3a347
Browse files Browse the repository at this point in the history
  • Loading branch information
CoolCoderCarl authored May 20, 2022
2 parents 5a3a347 + 7865866 commit c9d5dbc
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -55,6 +56,7 @@ jobs:
build:
name: Build packages
runs-on: ${{ matrix.os }}
needs: prepare
strategy:
matrix:
include:
Expand Down
62 changes: 49 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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: |
<b>!!! FAILED !!!</b>
<b>Failed job:</b> 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
Expand All @@ -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
Expand All @@ -68,7 +101,7 @@ jobs:
build:
name: Build packages
needs: release
needs: [ prepare, release ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -153,6 +189,6 @@ jobs:
Branch: ${{ github.ref }}
<b>Release URL:</b> https://github.com/${{ github.repository }}/releases/tag/${{ needs.release.outputs.get_current_tag }}
<b>Release URL:</b> https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare.outputs.get_current_tag }}
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
8 changes: 6 additions & 2 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"categories": [
{
"title": "## 🚀 Features",
"title": "## Features",
"labels": ["develop"]
},
{
"title": "## Release",
"labels": ["release"]
}
]
}
}

0 comments on commit c9d5dbc

Please sign in to comment.