-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: initial version of this Discord <-> IRC bridge
- Loading branch information
Showing
17 changed files
with
900 additions
and
0 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,4 @@ | ||
__pycache__/ | ||
*.pyc | ||
/.env | ||
/.git/** |
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,9 @@ | ||
notifications: | ||
global: | ||
irc: | ||
- openttd | ||
- openttd.notice | ||
|
||
pull-request: | ||
issue: | ||
tag-created: |
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,8 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
inline-quotes = double | ||
|
||
# We use 'black' for coding style; these next two warnings are not PEP-8 | ||
# compliant. | ||
# E231 is a bug in 'black', see https://github.com/psf/black/issues/1202 | ||
ignore = E203, E231, W503 |
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,8 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
rebase-strategy: "disabled" | ||
open-pull-requests-limit: 10 |
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,33 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish_image: | ||
name: Publish image | ||
uses: OpenTTD/actions/.github/workflows/publish-image.yml@v3 | ||
|
||
# Currently this project is not deployed yet. | ||
# deploy: | ||
# name: Deploy | ||
# needs: | ||
# - publish_image | ||
|
||
# uses: OpenTTD/actions/.github/workflows/aws-deployment.yml@v3 | ||
# with: | ||
# is_staging: ${{ github.ref == 'refs/heads/main' }} | ||
# name: Dibridge | ||
# url_production: https://weblogs.openttd.org | ||
# url_staging: https://weblogs-staging.openttd.org | ||
# digest: ${{ needs.publish_image.outputs.digest }} | ||
# version: ${{ needs.publish_image.outputs.version }} | ||
# secrets: | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# AWS_REGION: ${{ secrets.AWS_REGION }} | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
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,94 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
codeql: | ||
name: Security and Quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: python -m pip install -r requirements.txt | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: python | ||
queries: security-and-quality | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
|
||
docker: | ||
name: Docker build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: false | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
flake8: | ||
name: Flake8 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Flake8 | ||
uses: TrueBrain/actions-flake8@v2 | ||
with: | ||
path: dibridge | ||
|
||
black: | ||
name: Black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Set up packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install black | ||
- name: Black | ||
run: | | ||
black -l 120 --check dibridge | ||
check_annotations: | ||
name: Check Annotations | ||
needs: | ||
- docker | ||
- flake8 | ||
- black | ||
# not codeql, as that reports its own status | ||
|
||
if: always() && github.event_name == 'pull_request' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check annotations | ||
uses: OpenTTD/actions/annotation-check@v2 |
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,3 @@ | ||
__pycache__/ | ||
*.pyc | ||
/.env |
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 @@ | ||
dev |
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,31 @@ | ||
FROM python:3.10-slim | ||
|
||
ARG BUILD_VERSION="dev" | ||
|
||
# In order to install a non-release dependency, we need git. | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /code | ||
|
||
COPY requirements.txt \ | ||
LICENSE \ | ||
README.md \ | ||
/code/ | ||
# Needed for Sentry to know what version we are running | ||
RUN echo "${BUILD_VERSION}" > /code/.version | ||
|
||
RUN pip --no-cache-dir install -U pip \ | ||
&& pip --no-cache-dir install -r requirements.txt | ||
|
||
# Validate that what was installed was what was expected | ||
RUN pip freeze 2>/dev/null > requirements.installed \ | ||
&& diff -u --strip-trailing-cr requirements.txt requirements.installed 1>&2 \ | ||
|| ( echo "!! ERROR !! requirements.txt defined different packages or versions for installation" \ | ||
&& exit 1 ) 1>&2 | ||
|
||
COPY dibridge /code/dibridge | ||
|
||
ENTRYPOINT ["python", "-m", "dibridge"] | ||
CMD [] |
Oops, something went wrong.