Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DestroyCom authored Oct 13, 2023
2 parents 3ebdfc1 + af46f6a commit 43853f7
Show file tree
Hide file tree
Showing 60 changed files with 8,471 additions and 2,942 deletions.
24 changes: 16 additions & 8 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
BOT_TOKEN = Your_Bot_Token
LOG_DIR = Your_Log_Dir
TRIGGER_PREFIX = '&'
TIMEZONE = 'Europe/Paris'
#CHANNEL_ID = Your_Channel_Id
#VOICE_CHANNEL_ID = Your_Voice_Channel_Id
#USER_ID = Your_User_Id
#XIAOMI_SONG = false
#REQUIRED
DISCORD_TOKEN =
DISCORD_CLIENT_ID =
DATABASE_CONNECTION_STRING =
DATABASE_USER =
DATABASE_PASSWORD =
#OPTIONAL
DATABASE_NAME = "stroycord"
PREFIX = "&"
DETECT_FROM_ALL_MESSAGES = false
LOG_DIR = "./logs"
LANGUAGE = "en-US"
STROYCORD_LOGO = "https://destroykeaum.alwaysdata.net/assets/other/stroybot_logo.png"
#DOCKER
TIMEZONE = "Europe/Paris"

4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.prettierrc.js
.eslintrc.js
36 changes: 36 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.ts'],
},
},
},
env: {
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended', // Make sure this is always the last element in the array.
],
plugins: ['simple-import-sort', 'prettier'],
rules: {
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'@typescript-eslint/explicit-function-return-type': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/no-unused-vars': ['error'],
},
};
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker build
on:
workflow_call:
workflow_dispatch:
inputs:
tag:
description: 'Tag to use for the image'
required: true

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: release
fetch-depth: 0
- name: Get Latest Tag
id: latest_tag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Echo latest tag
run: echo '${{ steps.latest_tag.outputs.tag }}'
- name: Kaniko build
uses: aevea/action-kaniko@master
with:
image: destcom/stroycord
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tag: ${{ github.event.inputs.tag || steps.latest_tag.outputs.tag }}
tag_with_latest: true
build_file: ./StroyCord.Dockerfile
31 changes: 31 additions & 0 deletions .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create new tag based on last commit message

on:
workflow_call:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: release
fetch-depth: 0
- name: Get last commit message
id: commit_message
run: |
MESSAGE=$(git log -1 --pretty=format:'%s')
CLEANED_MESSAGE=$(echo "$MESSAGE" | sed -e 's/[^a-zA-Z0-9.-]/-/g')
echo "COMMIT_MSG=${CLEANED_MESSAGE}" >> $GITHUB_ENV
- name: Create or update major version
uses: joutvhu/create-tag@v1
with:
tag_name: ${{ env.COMMIT_MSG }}
message: ${{ env.COMMIT_MSG }}
on_tag_exists: update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release pipeline

on:
push:
branches:
- release
workflow_dispatch:

jobs:
create_tag:
uses: ./.github/workflows/create_tag.yml
secrets: inherit
build:
needs: create_tag
uses: ./.github/workflows/build.yml
secrets: inherit
release:
needs: [build]
uses: ./.github/workflows/release.yml
secrets: inherit
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create a release

on:
workflow_call:
workflow_dispatch:

jobs:
launch_release:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
- name: Get Latest Tag
id: latest_tag
uses: WyriHaximus/github-action-get-previous-tag@v1
- name: Echo latest tag
run: echo '${{ steps.latest_tag.outputs.tag }}'
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
tag_name: ${{ steps.latest_tag.outputs.tag }}
name: ${{ steps.latest_tag.outputs.tag }}
31 changes: 3 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
node_modules
.env
coverage
logs*
mongo*
dist
.idea
.vscode
npm-debug.log
.tmp
.DS_Store
yarn-error.log
temp
public
.log
docs
.nyc_output
cassettes
keys
embeds
ffmpeg.exe
ffplay.exe
ffprobe.exe
deletedCode
codeExample
src
.env.test
.env.prin
.env.copy
codeExample
OLD
wait_*
log*
```
9 changes: 9 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if [[ "$OSTYPE" == "msys" ]]; then
npx.cmd --no -- commitlint --edit ${1}
else
npx --no -- commitlint --edit ${1}
fi

10 changes: 10 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if [[ "$OSTYPE" == "msys" ]]; then
npm.cmd run lint -- --fix
else
npm run lint -- --fix
fi


8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"endOfLine": "auto"
}
15 changes: 0 additions & 15 deletions Dockerfile

This file was deleted.

Loading

0 comments on commit 43853f7

Please sign in to comment.