Skip to content

Commit

Permalink
upgrade: workflows, bins
Browse files Browse the repository at this point in the history
Pure-Peace committed May 19, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent c589920 commit c8c9a7a
Showing 3 changed files with 70 additions and 10 deletions.
65 changes: 59 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ on:
types: [created]

jobs:
build:
build-with-peace:
runs-on: ubuntu-latest

steps:
@@ -18,18 +18,18 @@ jobs:
override: true

- name: Build
run: cargo build --all --release
run: cargo build --features with_peace --release --bin pp-server-with-peace

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/peace
target/release/pp-server-with-peace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-win:
build-with-peace-win:
runs-on: windows-latest

steps:
@@ -44,12 +44,65 @@ jobs:
override: true

- name: Build
run: cargo build --release
run: cargo build --features with_peace --release --bin pp-server-with-peace

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/release/peace.exe
files: |
target/release/pp-server-with-peace.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-without-db:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true

- name: Build
run: cargo build --no-default-features --features peace-objects/no_database --release --bin pp-server-without-db

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/pp-server-without-db
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-without-db-win:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true

- name: Build
run: cargo build --no-default-features --features peace-objects/no_database --release --bin pp-server-without-db

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/release/pp-server-without-db.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[package]
name = "pp-server"
version = "0.4.0"
version = "0.4.1"
authors = ["Pure-Peace <[email protected]>"]
edition = "2018"
license = "MIT"
repository = "https://github.com/pure-peace/pp-server"

[[bin]]
name = "pp-server-with-peace"
path = "src/main.rs"

[[bin]]
name = "pp-server-without-db"
path = "src/main.rs"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
# default = ["peace-objects/no_database"] # Not use peace database, run pp-server independently.
@@ -51,7 +59,7 @@ tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-serde_j
peace-performance = { git = "https://github.com/Pure-Peace/Peace-performance.git", branch = "main" }

# Git
peace-constants = {git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }
peace-constants = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }
peace-database = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main", features = ["with_peace"], optional = true }
peace-objects = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main", features = ["osu_file_downloader"], optional = true }
peace-settings = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }
3 changes: 1 addition & 2 deletions src/objects/calculator.rs
Original file line number Diff line number Diff line change
@@ -263,15 +263,14 @@ pub async fn get_beatmap_from_api(
let expires = glob.local_config.data.beatmap_cache_timeout as i64;
#[cfg(not(feature = "with_peace"))]
let osu_api = &glob.osu_api;
let a = glob.database.get_ref();
peace_objects::beatmaps::Beatmap::get(
request_md5,
None,
sid,
file_name,
&osu_api,
#[cfg(feature = "with_peace")]
a,
glob.database.get_ref(),
true,
&glob.caches.beatmap_cache,
expires,

0 comments on commit c8c9a7a

Please sign in to comment.