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

Commit

Permalink
Fix: v2.2.4
Browse files Browse the repository at this point in the history
This patch update contains a new Debian-based docker image, small improvements to the reddit cog, and mostly dependencies updates. For more info, please check out the changelog. - Noelle
  • Loading branch information
No767 committed Sep 6, 2022
2 parents 2f109de + 6d1f61e commit 6e99a30
Show file tree
Hide file tree
Showing 21 changed files with 1,029 additions and 421 deletions.
26 changes: 26 additions & 0 deletions .env-docker-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
##################################################################
# Rin's Example ENV #
# Replace the values with the appropriate values #
##################################################################

# Prod Bot Token
TOKEN="botToken"

# Note that if you are using the production builds, use the same exact token as TOKEN.
# If you are using the development builds, use the token that you wish to use for the dev bot.
TESTING_BOT_TOKEN="testBotToken"

# API Keys + Access Tokens
BLUE_ALLIANCE_API_KEY="apiKey"
DISCORD_BOTS_API_KEY="apiKey"
FIRST_EVENTS_FINAL_KEY="apiKey"
GITHUB_API_ACCESS_TOKEN="apiKey"
HYPIXEL_API_KEY="apiKey"
REDDIT_ID="apiKey"
REDDIT_SECRET="apiKey"
TENOR_API_KEY="apiKey"
TOP_GG_API_KEY="apiKey"
TWITCH_API_ACCESS_TOKEN="apiKey"
TWITCH_API_CLIENT_ID="apiKey"
TWITTER_BEARER_TOKEN="apiKey"
YOUTUBE_API_KEY="apiKey"
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
name: Docker Build (GHCR)
name: Docker Build (GHCR, Alpine)

on:
push:
paths-ignore:
- "**.md"
branches:
- master
- dev
tags:
- 'v*'

env:
IMAGE: ghcr.io/no767/rin
VERSION: latest
DEV_TAGGED_VERSION: v2.2.0-dev

jobs:
Build:
Expand All @@ -22,21 +17,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Defer workflow for 60 seconds
run: sleep 60s
shell: bash

- name: Prepare Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/no767/rin
tags: |
type=raw,value=v2.2.3
type=edge,branch=dev,suffix=-{{sha}}
flavor: |
latest=true
type=semver,pattern={{raw}},suffix=-alpine
type=semver,pattern={{version}},suffix=-alpine
type=semver,pattern={{major}}.{{minor}},suffix=-alpine
type=semver,pattern={{major}},suffix=-alpine
type=edge,branch=dev,suffix=-alpine
- name: Setup Docker Buildx
id: buildx
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/docker-build-ghcr-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Docker Build (GHCR, Debian)

on:
push:
paths-ignore:
- "**.md"
branches:
- dev
tags:
- 'v*'


jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/no767/rin
tags: |
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{raw}},suffix=-bullseye
type=semver,pattern={{version}},suffix=-bullseye
type=semver,pattern={{major}}.{{minor}},suffix=-bullseye
type=semver,pattern={{major}},suffix=-bullseye
type=edge,branch=dev,suffix=-bullseye
type=edge,branch=dev
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Debian-Docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Move Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
name: Docker Build (Docker Hub)
name: Docker Build (Hub, Alpine)

on:
push:
paths-ignore:
- "**.md"
branches:
- master
- dev
tags:
- 'v*'

env:
IMAGE: no767/rin-prod
VERSION: latest
DEV_TAGGED_VERSION: v2.2.0-dev

jobs:
Build:
Expand All @@ -22,21 +17,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Defer workflow for 60 seconds
run: sleep 60s
shell: bash

- name: Prepare Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
no767/rin-prod
tags: |
type=raw,value=v2.2.3
type=edge,branch=dev
flavor: |
latest=true
type=semver,pattern={{raw}},suffix=-alpine
type=semver,pattern={{version}},suffix=-alpine
type=semver,pattern={{major}}.{{minor}},suffix=-alpine
type=semver,pattern={{major}},suffix=-alpine
type=edge,branch=dev,suffix=-alpine
- name: Setup Docker Buildx
id: buildx
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/docker-build-hub-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Docker Build (Hub, Debian)

on:
push:
paths-ignore:
- "**.md"
branches:
- dev
tags:
- 'v*'


jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare Docker Meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
no767/rin-prod
tags: |
type=semver,pattern={{raw}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{raw}},suffix=-bullseye
type=semver,pattern={{version}},suffix=-bullseye
type=semver,pattern={{major}}.{{minor}},suffix=-bullseye
type=semver,pattern={{major}},suffix=-bullseye
type=edge,branch=dev,suffix=-bullseye
type=edge,branch=dev
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Debian-Docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Move Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Create Tag + Bump Version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.PAT_TOKEN }}
release_branches: master
default_bump: minor
custom_release_rules: "Release:major,Update:minor,Fix:patch"
Expand All @@ -22,6 +22,6 @@ jobs:
uses: ncipollo/release-action@v1
with:
bodyFile: "changelog.md"
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.PAT_TOKEN }}
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ daTokens/
button-test.py
spotify-links.txt
Bot/Cogs/test.py
test.sh
test.sh
smarter-help.py
4 changes: 1 addition & 3 deletions Alpine-Docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env bash

# Note that this won't be used on Kumiko. Kumiko uses a different system instead
#!/bin/bash

if [[ -v TOKEN ]]; then
echo "TOKEN=${TOKEN}" >> /Rin/Bot/.env
Expand Down
10 changes: 5 additions & 5 deletions Bot/Cogs/jisho.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import orjson
import simdjson
import uvloop
from discord.commands import Option, slash_command
from discord.commands import Option, SlashCommandGroup
from discord.ext import commands, pages

parser = simdjson.Parser()
Expand All @@ -15,10 +15,9 @@ class jishoDict(commands.Cog):
def __init__(self, bot):
self.bot = bot

@slash_command(
name="jisho",
description="Searches for words on Jisho",
)
jisho = SlashCommandGroup("jisho", "Jisho API")

@jisho.command(name="search")
async def jishoSearcher(
self,
ctx,
Expand All @@ -27,6 +26,7 @@ async def jishoSearcher(
"The word you want to search for. It could be in either English or Japanese.",
),
):
"""Searches for words on Jisho"""
async with aiohttp.ClientSession(json_serialize=orjson.dumps) as session:
params = {"keyword": search}
async with session.get(
Expand Down
Loading

0 comments on commit 6e99a30

Please sign in to comment.