Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
feat: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Dec 23, 2023
1 parent 2e0f9b0 commit 9bd69ce
Show file tree
Hide file tree
Showing 50 changed files with 1,983 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
filename =
*.py,
*.pys
max-line-length = 120
extend-exclude =
venv/
48 changes: 48 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
time: "08:00"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "08:30"
open-pull-requests-limit: 10

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
time: "09:00"
open-pull-requests-limit: 10

- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "daily"
time: "09:30"
open-pull-requests-limit: 10

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "10:00"
open-pull-requests-limit: 10

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
time: "10:30"
open-pull-requests-limit: 10
49 changes: 49 additions & 0 deletions .github/label-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# Configuration for Label Actions - https://github.com/dessant/label-actions

added:
comment: >
This feature has been added and will be available in the next release.
fixed:
comment: >
This issue has been fixed and will be available in the next release.
invalid:duplicate:
comment: >
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue.
close: true
lock: true
unlabel: 'status:awaiting-triage'

-invalid:duplicate:
reopen: true
unlock: true

invalid:support:
comment: >
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
However, this issue appears to be a support request. Please use our
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
close: true
lock: true
lock-reason: 'off-topic'
unlabel: 'status:awaiting-triage'

-invalid:support:
reopen: true
unlock: true

invalid:template-incomplete:
issues:
comment: >
:wave: @{issue-author}, please edit your issue to complete the template with
all the required info. Your issue will be automatically closed in 5 days if
the template is not completed. Thanks.
prs:
comment: >
:wave: @{issue-author}, please edit your PR to complete the template with
all the required info. Your PR will be automatically closed in 5 days if
the template is not completed. Thanks.
28 changes: 28 additions & 0 deletions .github/pr_release_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Description
<!--- Please include a summary of the changes. --->
This PR was created automatically.


### Screenshot
<!--- Include screenshots if the changes are UI-related. --->


### Issues Fixed or Closed
<!--- Close issue example: `- Closes #1` --->
<!--- Fix bug issue example: `- Fixes #2` --->
<!--- Resolve issue example: `- Resolves #3` --->


## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [ ] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files, e.g. `.github/...`)

## Branch Updates
- [x] I want maintainers to keep my branch updated

## Changelog Summary
<!--- Summarize all the changes in a bulleted list. --->
126 changes: 126 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
name: CI

on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
push:
branches: [master]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
setup_release:
name: Setup Release
outputs:
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
publish_release: ${{ steps.setup_release.outputs.publish_release }}
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
release_body: ${{ steps.setup_release.outputs.release_body }}
release_build: ${{ steps.setup_release.outputs.release_build }}
release_commit: ${{ steps.setup_release.outputs.release_commit }}
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
release_tag: ${{ steps.setup_release.outputs.release_tag }}
release_version: ${{ steps.setup_release.outputs.release_version }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Release
id: setup_release
uses: LizardByte/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

build:
needs:
- setup_release
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
# kodi uses 3.8? https://kodi.wiki/view/Python_libraries
python-version: '3.8'

- name: Install python dependencies
shell: bash
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-dev.txt
python -m pip install -r requirements.txt
- name: Compile Locale Translations
shell: bash
run: |
python -m scripts.locale --compile
- name: Build
shell: bash
env:
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
run: |
python -m scripts.build
- name: Package Release
shell: bash
run: |
7z \
a "./service.themerr.zip" "service.themerr"
mkdir artifacts
mv ./service.themerr.zip ./artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: service.themerr
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}/artifacts
- name: Test with pytest
id: test
shell: bash
run: |
python -m pytest \
-rxXs \
--tb=native \
--verbose \
--cov=src \
tests
- name: Upload coverage
# any except canceled or skipped
if: always() && (steps.test.outcome == 'success' || steps.test.outcome == 'failure')
uses: codecov/codecov-action@v3

- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
uses: LizardByte/[email protected]
with:
allowUpdates: true
body: ''
discussionCategory: announcements
generateReleaseNotes: true
name: ${{ needs.setup_release.outputs.release_tag }}
prerelease: ${{ needs.setup_release.outputs.publish_pre_release }}
tag: ${{ needs.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/auto-create-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created
# against the `master` (default) branch.

name: Auto create PR

on:
push:
branches:
- 'nightly'

jobs:
create_pr:
if: startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: "" # should be "nightly" as it's the triggering branch
destination_branch: "master"
pr_title: "Pulling ${{ github.ref_name }} into master"
pr_template: ".github/pr_release_template.md"
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
pr_draft: true
pr_allow_empty: false
github_token: ${{ secrets.GH_BOT_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
# This action is centrally managed in https://github.com/<organization>/.github/
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# This workflow will, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs.

name: Automerge PR

on:
pull_request:
types:
- opened
- synchronize

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
autoapprove:
if: >-
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
startsWith(github.repository, 'LizardByte/')
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v3
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Label autoapproved
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GH_BOT_TOKEN }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['autoapproved', 'autoupdate']
})
automerge:
if: startsWith(github.repository, 'LizardByte/')
needs: [autoapprove]
runs-on: ubuntu-latest

steps:
- name: Automerging
uses: pascalgn/[email protected]
env:
BASE_BRANCHES: nightly
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
MERGE_LABELS: "!dependencies"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
MERGE_DELETE_BRANCH: true
MERGE_ERROR_FAIL: true
MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }}
MERGE_RETRIES: "240" # 1 hour
MERGE_RETRY_SLEEP: "15000" # 15 seconds
Loading

0 comments on commit 9bd69ce

Please sign in to comment.