This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
175 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build packages | ||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
get_current_tag: ${{ steps.set_current_tag_id.outputs.current_tag }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
TARGET: windows | ||
CMD_BUILD: python -m PyInstaller --workpath /tmp/build --specpath /tmp -F butler.py | ||
OUT_FILE_NAME: butler.exe | ||
ASSET_MIME: application/vnd.microsoft.portable-executable | ||
- os: ubuntu-latest | ||
TARGET: ubuntu | ||
CMD_BUILD: python -m PyInstaller --workpath /tmp/build --specpath /tmp -F butler.py | ||
OUT_FILE_NAME: butler | ||
ASSET_MIME: application/x-binary | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v6.0 | ||
with: | ||
github_token: ${{ secrets.REPOS_TOKEN }} | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Build with pyinstaller for ${{ matrix.TARGET }} | ||
run: ${{ matrix.CMD_BUILD }} | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.OUT_FILE_NAME }} | ||
path: ./dist/${{ matrix.OUT_FILE_NAME }} | ||
retention-days: 1 | ||
|
||
- 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: Step To run on 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 }} | ||
telegram: | ||
runs-on: ubuntu-latest | ||
name: Notification | ||
needs: [ build ] | ||
|
||
steps: | ||
- name: Notify telegram message after Packaging | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_CHAT }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: html | ||
message: | | ||
${{ github.actor }} created commit: | ||
<b>WorkFlows:</b> <a href="https://github.com/${{ github.repository }}/actions">ActionsList</a> | ||
Commit with tag: ${{ needs.build.outputs.get_current_tag }} | ||
Repository: ${{ github.repository }} | ||
Branch: ${{ github.ref }} | ||
<b>Artifacts:</b> https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
See changes: https://github.com/${{ github.repository }}/commit/${{ github.sha }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Code Quality | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
code_quality: | ||
runs-on: ubuntu-latest | ||
name: Checks with blacks, isort | ||
container: python:3.9 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run script | ||
run: | | ||
pip install -r requirements.txt | ||
ls -la | ||
- name: Black check | ||
run: | ||
black --check . | ||
|
||
- name: Isort check | ||
run: | ||
isort --check . | ||
|
||
- name: Step To run on 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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters