Skip to content

Commit c8c9a7a

Browse files
committed
upgrade: workflows, bins
1 parent c589920 commit c8c9a7a

3 files changed

Lines changed: 70 additions & 10 deletions

File tree

.github/workflows/release.yml

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
types: [created]
44

55
jobs:
6-
build:
6+
build-with-peace:
77
runs-on: ubuntu-latest
88

99
steps:
@@ -18,18 +18,18 @@ jobs:
1818
override: true
1919

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

2323
- name: Release
2424
uses: softprops/action-gh-release@v1
2525
if: startsWith(github.ref, 'refs/tags/')
2626
with:
2727
files: |
28-
target/release/peace
28+
target/release/pp-server-with-peace
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131

32-
build-win:
32+
build-with-peace-win:
3333
runs-on: windows-latest
3434

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

4646
- name: Build
47-
run: cargo build --release
47+
run: cargo build --features with_peace --release --bin pp-server-with-peace
4848

4949
- name: Release
5050
uses: softprops/action-gh-release@v1
5151
if: startsWith(github.ref, 'refs/tags/')
5252
with:
53-
files: target/release/peace.exe
53+
files: |
54+
target/release/pp-server-with-peace.exe
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
build-without-db:
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v1
64+
65+
- name: Install latest rust toolchain
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: stable
69+
default: true
70+
override: true
71+
72+
- name: Build
73+
run: cargo build --no-default-features --features peace-objects/no_database --release --bin pp-server-without-db
74+
75+
- name: Release
76+
uses: softprops/action-gh-release@v1
77+
if: startsWith(github.ref, 'refs/tags/')
78+
with:
79+
files: |
80+
target/release/pp-server-without-db
5481
env:
5582
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
84+
build-without-db-win:
85+
runs-on: windows-latest
86+
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v1
90+
91+
- name: Install latest rust toolchain
92+
uses: actions-rs/toolchain@v1
93+
with:
94+
toolchain: stable
95+
default: true
96+
override: true
97+
98+
- name: Build
99+
run: cargo build --no-default-features --features peace-objects/no_database --release --bin pp-server-without-db
100+
101+
- name: Release
102+
uses: softprops/action-gh-release@v1
103+
if: startsWith(github.ref, 'refs/tags/')
104+
with:
105+
files: |
106+
target/release/pp-server-without-db.exe
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
[package]
22
name = "pp-server"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
authors = ["Pure-Peace <940857703@qq.com>"]
55
edition = "2018"
66
license = "MIT"
77
repository = "https://github.com/pure-peace/pp-server"
88

9+
[[bin]]
10+
name = "pp-server-with-peace"
11+
path = "src/main.rs"
12+
13+
[[bin]]
14+
name = "pp-server-without-db"
15+
path = "src/main.rs"
16+
917
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1018
[features]
1119
# 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
5159
peace-performance = { git = "https://github.com/Pure-Peace/Peace-performance.git", branch = "main" }
5260

5361
# Git
54-
peace-constants = {git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }
62+
peace-constants = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }
5563
peace-database = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main", features = ["with_peace"], optional = true }
5664
peace-objects = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main", features = ["osu_file_downloader"], optional = true }
5765
peace-settings = { git = "https://github.com/Pure-Peace/Peace.git", branch = "main" }

src/objects/calculator.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,14 @@ pub async fn get_beatmap_from_api(
263263
let expires = glob.local_config.data.beatmap_cache_timeout as i64;
264264
#[cfg(not(feature = "with_peace"))]
265265
let osu_api = &glob.osu_api;
266-
let a = glob.database.get_ref();
267266
peace_objects::beatmaps::Beatmap::get(
268267
request_md5,
269268
None,
270269
sid,
271270
file_name,
272271
&osu_api,
273272
#[cfg(feature = "with_peace")]
274-
a,
273+
glob.database.get_ref(),
275274
true,
276275
&glob.caches.beatmap_cache,
277276
expires,

0 commit comments

Comments
 (0)