mirror of
https://github.com/eRgo35/lyra.git
synced 2026-02-04 20:36:10 +01:00
Compare commits
9 Commits
0.10.1
...
release-pl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
051ae857a7 | ||
|
08fbdc828c
|
|||
|
aeb10d9baf
|
|||
|
af247aa6d5
|
|||
| eae957c6d7 | |||
|
5399f3ba6d
|
|||
|
076dfd0a93
|
|||
|
212abd9bdd
|
|||
|
8d787f2a11
|
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -1,46 +1,22 @@
|
|||||||
name: ci
|
name: Rust
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [senpai]
|
branches: [ "senpai" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [senpai]
|
branches: [ "senpai" ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: 1
|
CARGO_TERM_COLOR: always
|
||||||
RUST_LOG: trace
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
name: test
|
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build
|
||||||
- name: Install Rust
|
run: cargo build --verbose
|
||||||
uses: actions-rs/toolchain@v1
|
- name: Run tests
|
||||||
with:
|
run: cargo test --verbose
|
||||||
toolchain: stable
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: Set up cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Build projectable
|
|
||||||
run: cargo build --verbose
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: cargo test --verbose
|
|
||||||
|
|||||||
27
.github/workflows/release-plz.yml
vendored
Normal file
27
.github/workflows/release-plz.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Release Plz
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- senpai
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release-plz:
|
||||||
|
name: Release-plz
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
- name: Run release-plz
|
||||||
|
uses: MarcoIeni/release-plz-action@v0.5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
|
||||||
|
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||||
119
.github/workflows/release.yml
vendored
119
.github/workflows/release.yml
vendored
@@ -1,119 +0,0 @@
|
|||||||
name: release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
|
|
||||||
permissions: write-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Creates a release and outputs the url
|
|
||||||
create-release:
|
|
||||||
name: create-release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ env.RELEASE_UPLOAD_URL }}
|
|
||||||
version: ${{ env.VERSION }}
|
|
||||||
steps:
|
|
||||||
- name: Get the release version from the tag
|
|
||||||
shell: bash
|
|
||||||
if: env.VERSION == ''
|
|
||||||
run: |
|
|
||||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
||||||
echo "version is: ${{ env.VERSION }}"
|
|
||||||
- name: Create GitHub release
|
|
||||||
uses: actions/github-script@v6
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
script: |
|
|
||||||
try {
|
|
||||||
const response = await github.rest.repos.createRelease({
|
|
||||||
draft: false,
|
|
||||||
generate_release_notes: true,
|
|
||||||
name: process.env.VERSION,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
prerelease: false,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
tag_name: process.env.VERSION,
|
|
||||||
});
|
|
||||||
|
|
||||||
core.exportVariable('RELEASE_ID', response.data.id);
|
|
||||||
core.exportVariable('RELEASE_UPLOAD_URL', response.data.upload_url);
|
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(error.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
build-and-upload:
|
|
||||||
name: Build and upload
|
|
||||||
needs: create-release
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
build: [linux-gnu, linux-aarch64-gnu]
|
|
||||||
include:
|
|
||||||
- build: linux-gnu
|
|
||||||
os: ubuntu-latest
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
- build: linux-aarch64-gnu
|
|
||||||
os: ubuntu-latest
|
|
||||||
target: aarch64-unknown-linux-gnu
|
|
||||||
use-cross: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
profile: minimal
|
|
||||||
override: true
|
|
||||||
target: ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
use-cross: ${{ matrix.use-cross }}
|
|
||||||
command: build
|
|
||||||
args: --verbose --release --target ${{ matrix.target }}
|
|
||||||
|
|
||||||
- name: Strip release binary (linux and macos)
|
|
||||||
if: matrix.build == 'linux-gnu' || matrix.build == 'linux-musl' || matrix.build == 'macos' || matrix.build == 'linux-aarch64-gnu'
|
|
||||||
run: strip "target/${{ matrix.target }}/release/lyra"
|
|
||||||
|
|
||||||
- name: Build archive
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
dirname="lyra-${{ needs.create-release.outputs.version }}-${{ matrix.target }}"
|
|
||||||
mkdir "$dirname"
|
|
||||||
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
||||||
mv "target/${{ matrix.target }}/release/lyra.exe" "$dirname"
|
|
||||||
else
|
|
||||||
mv "target/${{ matrix.target }}/release/lyra" "$dirname"
|
|
||||||
fi
|
|
||||||
mv LICENSE.md "$dirname"
|
|
||||||
|
|
||||||
if [ "${{ matrix.os }}" = "windows-latest" ]; then
|
|
||||||
7z a "$dirname.zip" "$dirname"
|
|
||||||
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
tar -czf "$dirname.tar.gz" "$dirname"
|
|
||||||
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload archive
|
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ needs.create-release.outputs.upload_url }}
|
|
||||||
asset_path: ${{ env.ASSET }}
|
|
||||||
asset_name: ${{ env.ASSET }}
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
12
.gitmodules
vendored
12
.gitmodules
vendored
@@ -1,12 +0,0 @@
|
|||||||
[submodule "libs/songbird"]
|
|
||||||
path = libs/songbird
|
|
||||||
url = git@github.com:eRgo35/songbird.git
|
|
||||||
[submodule "libs/serenity"]
|
|
||||||
path = libs/serenity
|
|
||||||
url = git@github.com:eRgo35/serenity.git
|
|
||||||
[submodule "libs/poise"]
|
|
||||||
path = libs/poise
|
|
||||||
url = git@github.com:eRgo35/poise.git
|
|
||||||
[submodule "libs/spotify-parser"]
|
|
||||||
path = libs/spotify-parser
|
|
||||||
url = git@github.com:eRgo35/spotify-parser.git
|
|
||||||
13
CHANGELOG.md
Normal file
13
CHANGELOG.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.10.3](https://github.com/eRgo35/lyra/compare/v0.10.2...v0.10.3) - 2024-08-13
|
||||||
|
|
||||||
|
### Other
|
||||||
|
- release-plz
|
||||||
|
# Changelog
|
||||||
30
Cargo.lock
generated
30
Cargo.lock
generated
@@ -1266,18 +1266,6 @@ version = "1.0.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
|
checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "lib-spotify-parser"
|
|
||||||
version = "1.0.0"
|
|
||||||
dependencies = [
|
|
||||||
"regex",
|
|
||||||
"reqwest 0.12.5",
|
|
||||||
"scraper",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tokio",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.155"
|
version = "0.2.155"
|
||||||
@@ -1323,11 +1311,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lyra"
|
name = "lyra"
|
||||||
version = "0.10.0"
|
version = "0.10.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dotenv",
|
"dotenv",
|
||||||
"json",
|
"json",
|
||||||
"lib-spotify-parser",
|
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"openssl",
|
"openssl",
|
||||||
"owoify",
|
"owoify",
|
||||||
@@ -1339,6 +1326,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"serenity",
|
"serenity",
|
||||||
"songbird",
|
"songbird",
|
||||||
|
"spotify-parser",
|
||||||
"symphonia",
|
"symphonia",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
@@ -2859,6 +2847,20 @@ dependencies = [
|
|||||||
"lock_api",
|
"lock_api",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "spotify-parser"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e7b9d1d990125af02c6f611f2e8e34fd979310d43ae7ac5bd2cd357b87b13352"
|
||||||
|
dependencies = [
|
||||||
|
"regex",
|
||||||
|
"reqwest 0.12.5",
|
||||||
|
"scraper",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stable-vec"
|
name = "stable-vec"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lyra"
|
name = "lyra"
|
||||||
version = "0.10.1"
|
version = "0.10.3"
|
||||||
authors = ["Michał Czyż <mike@c2yz.com>"]
|
authors = ["Michał Czyż <mike@c2yz.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A featureful Discord bot written in Rust."
|
description = "A featureful Discord bot written in Rust."
|
||||||
@@ -11,7 +11,7 @@ license-file = "LICENSE.md"
|
|||||||
keywords = ["discord", "bot", "rust", "music", "featureful"]
|
keywords = ["discord", "bot", "rust", "music", "featureful"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lib-spotify-parser = { path = "./libs/spotify-parser" }
|
spotify-parser = "1.0.1"
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
json = "0.12.4"
|
json = "0.12.4"
|
||||||
openssl = { version = "0.10.66", features = ["vendored"] }
|
openssl = { version = "0.10.66", features = ["vendored"] }
|
||||||
|
|||||||
Submodule libs/poise deleted from 575025909b
Submodule libs/serenity deleted from 658b6a7261
Submodule libs/songbird deleted from 2d7dc29fd6
Submodule libs/spotify-parser deleted from 4398512b5c
@@ -2,7 +2,6 @@ use crate::commands::music::metadata::Metadata;
|
|||||||
use crate::commands::music::notifier::TrackErrorNotifier;
|
use crate::commands::music::notifier::TrackErrorNotifier;
|
||||||
use crate::{commands::embeds::error_embed, Context, Error};
|
use crate::{commands::embeds::error_embed, Context, Error};
|
||||||
|
|
||||||
use lib_spotify_parser;
|
|
||||||
use poise::serenity_prelude::{
|
use poise::serenity_prelude::{
|
||||||
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
Color, CreateEmbed, CreateEmbedAuthor, CreateEmbedFooter, Timestamp,
|
||||||
};
|
};
|
||||||
@@ -15,6 +14,7 @@ use songbird::input::AuxMetadata;
|
|||||||
use songbird::input::{Compose, YoutubeDl};
|
use songbird::input::{Compose, YoutubeDl};
|
||||||
use songbird::tracks::TrackQueue;
|
use songbird::tracks::TrackQueue;
|
||||||
use songbird::Call;
|
use songbird::Call;
|
||||||
|
use spotify_parser;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@@ -120,7 +120,7 @@ async fn handle_play<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn parse_data(data: String) -> VecDeque<String> {
|
async fn parse_data(data: String) -> VecDeque<String> {
|
||||||
let tracks = lib_spotify_parser::retrieve_async_url(&data)
|
let tracks = spotify_parser::retrieve_async_url(&data)
|
||||||
.await
|
.await
|
||||||
.unwrap_or(vec![data])
|
.unwrap_or(vec![data])
|
||||||
.iter()
|
.iter()
|
||||||
|
|||||||
Reference in New Issue
Block a user