Skip to content

Commit

Permalink
V0.2.14.rc0 (#117)
Browse files Browse the repository at this point in the history
* update dependencies, add footer to log embeds with time, start separating create_* functions into build/send

* Updates, and download feature

* use RwLock everywhere instead of Mutex

* switch mutex to rwlock

* download/upload version of play command

* try to fix mode play in prefix

* fix prefix download

* fix prefix download

* updates and tests

* Clean up and stuff

* rename create_ to send_ on the functions that send

* fix linting

* Found a regression in /play. Need to fix.

Fix chatgpt module and break some things

* stole by debugs droida

* fix?

* debug command

* cleanup

* logging update

* lint

* Cleanup *warning you probably broke something*

* tarpaulin configs

 Please enter the commit message for your changes. Lines starting

* lyrics and cleanup

* cargo updatge

* cleanup play command

* cleanup event_log

* don't use guild_bans intent anymore (it's subsumed in another?)

* fix unmute

* cleanup and att ErrorHttp

* raid defense measures

* play command update again

* get channel messages

* aasdf

* defend cleanup

* cleanup and update

* try to fix cicd

* fix again

* try cleaning this up again

* Message Deleting thing

* rework

* tarpaulin

* message cacge

* message cache command

* msg caching

* log handler

* cleanup and add handler to delete old messages from the bot

* fix one thing, break more

* a couple fixes and turn off deleting old messages from now

* Refactor now_playing

* fixes and comments

* asdf

* update some versions, add debugging

* Cleanup, add comments, and more testing stuff

* Clean up some logging

* try to fix response to playlist add

* fix play command hopefully

* fix voteskip and add cancel to defend

* cleanup and add move users

* fix trapdoor cancel

* Do the insert right

* don't log bot messages or updates

* Asdf

* cleanup

* cleanup

* rework additional prefixes

* asdf

* getting dbs updated

* try to fix plylist stuff

* database stuff

* try to fix tests

* asdf

* add postgres to builds

linting

* try to fix again

* asdf

* use fields for youtube results

* try to new repo for github action

* move position in pipeline of postgres

* fix set welcome settings and add set auto role

* asdf

* move set_auto_role to it's own file

* refactor

* try to fix ci

* linting

* asdf

* asdf
  • Loading branch information
cycle-five authored Dec 3, 2023
1 parent 9a6b28c commit 15a9f60
Show file tree
Hide file tree
Showing 147 changed files with 3,683 additions and 1,890 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ OPENAI_KEY=XXXXXX

# [Optional] Database URL for the bot to use.
#
DATABASE_URL=sqlite:///data/crackedmusic.db
DATABASE_URL=postgres:///data/crackedmusic.db
PG_USER=postgres
PG_PASSWORD=mysecretpassword
32 changes: 24 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ jobs:
name: Build
strategy:
matrix:
rust-version: ['nightly', 'stable']
cache-key: ['']
rust-version: ["nightly", "stable"]
cache-key: [""]
runs-on: ubuntu-latest
# redis:
# image: redis:latest
# ports:
# - 6379/tcp

steps:
- name: Repository Checkout
uses: actions/checkout@v4
Expand All @@ -19,18 +24,29 @@ jobs:
run: |
rustup toolchain install ${{ matrix.rust-version }} --profile minimal --no-self-update
rustup default ${{ matrix.rust-version }}
rustup update
shell: bash

- uses: ikalnytskyi/action-setup-postgres@v4
with:
username: postgres
password: mysecretpassword
database: postgres
port: 5432
id: postgres

- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.cache-key }}

- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite
run: cargo install sqlx-cli --no-default-features --features postgres

- name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
PG_USER: postgres
PG_PASSWORD: mysecretpassword
run: |
sqlx database create
sqlx migrate run --source migrations/
Expand All @@ -44,9 +60,9 @@ jobs:
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: cargo test --release --locked

- name: Build Binary
if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')
run: cargo build --locked
# - name: Build Binary
# if: github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')
# run: cargo build --locked

- name: Build Release Binary
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/bump.yml

This file was deleted.

53 changes: 48 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,59 @@ jobs:
test:
name: coverage
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:develop-nightly
options: --security-opt seccomp=unconfined
# container:
# image: xd009642/tarpaulin:develop-nightly
# options: --security-opt seccomp=unconfined
steps:
- name: Checkout repository
- name: Repository Checkout
uses: actions/checkout@v4

- name: "Install dependencies"
run: |
sudo apt-get update && sudo apt-get install -y cmake
shell: bash

- name: "Install Rust"
run: |
rustup toolchain install nightly --profile minimal --no-self-update
rustup default nightly
rustup update
shell: bash

- uses: Swatinem/rust-cache@v2
with:
shared-key: "coverage"

- name: "Install cargo-tarpaulin"
run: |
cargo install cargo-tarpaulin
shell: bash

- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres

- uses: ikalnytskyi/action-setup-postgres@v4
with:
username: postgres
password: mysecretpassword
database: postgres
port: 5432
id: postgres

- name: Migrate database
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
PG_USER: postgres
PG_PASSWORD: mysecretpassword
run: |
sqlx database create
sqlx migrate run --source migrations/
cargo sqlx prepare --workspace -- --tests
- name: Generate code coverage
env:
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
run: |
apt-get update && apt-get install -y cmake
cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml
- name: Upload to codecov.io
Expand Down
20 changes: 15 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,30 @@ jobs:
uses: actions/checkout@v4
-
name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite
run: cargo install sqlx-cli --no-default-features --features postgres
-
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: postgres
password: mysecretpassword
database: postgres
port: 5432
id: postgres
-
name: Cache
uses: Swatinem/rust-cache@v2
-
name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
run: |
sqlx database create
sqlx migrate run --source migrations/
cargo sqlx prepare --workspace
-
name: Build Docker Image
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: postgres://./data/crackedmusic.db
run: docker build . -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
push:
name: Build & Push Docker Image
Expand All @@ -53,7 +61,7 @@ jobs:
uses: Swatinem/rust-cache@v2
-
name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite
run: cargo install sqlx-cli --no-default-features --features postgres
-
name: Registry Login
uses: docker/login-action@v3
Expand All @@ -70,7 +78,9 @@ jobs:
-
name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: postgres://./data/crackedmusic.db
PG_USER: postgres
PG_PASSWORD: mysecretpassword
run: |
sqlx database create
sqlx migrate run --source migrations/
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ jobs:
uses: Swatinem/rust-cache@v2
-
name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite
run: cargo install sqlx-cli --no-default-features --features postgres
-
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: postgres
password: mysecretpassword
database: postgres
port: 5432
id: postgres
-
name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
PG_USER: postgres
PG_PASSWORD: mysecretpassword
run: |
sqlx database create
sqlx migrate run --source migrations/
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,47 @@ jobs:
name: Fmt and clippy
strategy:
matrix:
rust-version: ['nightly', 'stable']
cache-key: ['']
rust-version: ["nightly", "stable"]
cache-key: [""]
runs-on: ubuntu-latest

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

- name: "Install Rust"
run: |
rustup toolchain install ${{ matrix.rust-version }} --profile minimal --no-self-update
rustup default ${{ matrix.rust-version }}
rustup update
rustup component add rustfmt clippy --toolchain ${{ matrix.rust-version }}
shell: bash

-
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: postgres
password: mysecretpassword
database: postgres
port: 5432
id: postgres
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.cache-key }}

- name: Install sqlx-cli
run: cargo install sqlx-cli --no-default-features --features postgres,sqlite

run: cargo install sqlx-cli --no-default-features --features postgres
- name: Migrate database
env:
DATABASE_URL: sqlite://./data/crackedmusic.db
DATABASE_URL: ${{ steps.postgres.outputs.connection-uri }}
PG_USER: postgres
PG_PASSWORD: mysecretpassword
run: |
sqlx database create
sqlx migrate run --source migrations/
cargo sqlx prepare --workspace -- --tests
- name: Run cargo fmt
run: cargo fmt --all -- --check

- name: Run clippy
if: success() || failure()
run: cargo clippy --all -- -D clippy::all -D warnings

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ cracktunes.env

# submodules
dep-installer-hack/

# code coverage
cobertura.xml
Loading

0 comments on commit 15a9f60

Please sign in to comment.