3 Commits

Author SHA1 Message Date
486f403d10 chore: release 0.10.1 2024-08-12 18:20:24 +02:00
bfd301c9c2 fix: deps broken 2024-08-12 18:14:09 +02:00
670b8dd30e gh: actions 2024-08-12 18:13:59 +02:00
6 changed files with 171 additions and 27 deletions

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: eRgo35

46
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: ci
on:
push:
branches: [senpai]
pull_request:
branches: [senpai]
env:
RUST_BACKTRACE: 1
RUST_LOG: trace
jobs:
test:
name: test
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
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

119
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,119 @@
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

24
Cargo.lock generated
View File

@@ -90,32 +90,13 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "audiopus"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3743519567e9135cf6f9f1a509851cb0c8e4cb9d66feb286668afb1923bec458"
dependencies = [
"audiopus_sys 0.1.8",
]
[[package]] [[package]]
name = "audiopus" name = "audiopus"
version = "0.3.0-rc.0" version = "0.3.0-rc.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab55eb0e56d7c6de3d59f544e5db122d7725ec33be6a276ee8241f3be6473955" checksum = "ab55eb0e56d7c6de3d59f544e5db122d7725ec33be6a276ee8241f3be6473955"
dependencies = [ dependencies = [
"audiopus_sys 0.2.2", "audiopus_sys",
]
[[package]]
name = "audiopus_sys"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "927791de46f70facea982dbfaf19719a41ce6064443403be631a85de6a58fff9"
dependencies = [
"log",
"pkg-config",
] ]
[[package]] [[package]]
@@ -1344,7 +1325,6 @@ dependencies = [
name = "lyra" name = "lyra"
version = "0.10.0" version = "0.10.0"
dependencies = [ dependencies = [
"audiopus 0.2.0",
"dotenv", "dotenv",
"json", "json",
"lib-spotify-parser", "lib-spotify-parser",
@@ -2825,7 +2805,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "338dd182f9f084f583c4c0db38588e28a34778ecec288208cf0b61c378ac90d1" checksum = "338dd182f9f084f583c4c0db38588e28a34778ecec288208cf0b61c378ac90d1"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"audiopus 0.3.0-rc.0", "audiopus",
"byteorder", "byteorder",
"bytes", "bytes",
"crypto_secretbox", "crypto_secretbox",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "lyra" name = "lyra"
version = "0.10.0" version = "0.10.1"
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."
@@ -14,6 +14,7 @@ keywords = ["discord", "bot", "rust", "music", "featureful"]
lib-spotify-parser = { path = "./libs/spotify-parser" } lib-spotify-parser = { path = "./libs/spotify-parser" }
dotenv = "0.15.0" dotenv = "0.15.0"
json = "0.12.4" json = "0.12.4"
openssl = { version = "0.10.66", features = ["vendored"] }
owoify = "0.1.5" owoify = "0.1.5"
poise = { default-features = true, version = "0.6.1" } poise = { default-features = true, version = "0.6.1" }
rand = "0.8.5" rand = "0.8.5"
@@ -32,7 +33,6 @@ serenity = { default-features = true, features = [
"http", "http",
"rustls_backend", "rustls_backend",
], version = "0.12" } ], version = "0.12" }
symphonia = { version = "0.5.4", features = [ symphonia = { version = "0.5.4", features = [
"aac", "aac",
"adpcm", "adpcm",
@@ -47,8 +47,6 @@ tracing-futures = "0.2.5"
tracing-subscriber = "0.3.18" tracing-subscriber = "0.3.18"
url = "2.5.2" url = "2.5.2"
once_cell = "1.19.0" once_cell = "1.19.0"
openssl = { version = "0.10.66", features = ["vendored"] }
audiopus = "0.2.0"
[patch.crates-io.serenity-voice-model] [patch.crates-io.serenity-voice-model]
git = "https://github.com/serenity-rs/serenity" git = "https://github.com/serenity-rs/serenity"

View File

@@ -3,7 +3,7 @@
<img height="256" alt="Lyra" src="assets/lyra-256.png" /> <img height="256" alt="Lyra" src="assets/lyra-256.png" />
</a> </a>
<br /> <br />
Lyra: a discord music bot written in Rust :crab: Lyra: a discord music bot written in rust :crab:
</h2> </h2>
Lyra is an open source, discord music bot written in Rust. Lyra is an open source, discord music bot written in Rust.