Skip to content

Commit 379c308

Browse files
committed
Github publish action
1 parent 530c2b3 commit 379c308

File tree

4 files changed

+121
-8
lines changed

4 files changed

+121
-8
lines changed

.github/workflows/release.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
name: Release
7+
8+
jobs:
9+
build:
10+
name: ${{ matrix.name }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
name: ['macOS', 'Windows', 'Linux']
16+
include:
17+
- name: Linux
18+
os: ubuntu-latest
19+
copy: mkdir package && cp -R res config package/ && cd target/release && cp road model car level convert ../../package
20+
- name: macOS
21+
os: macos-latest
22+
copy: mkdir package && cp -R res config package/ && cd target/release && cp road model car level convert ../../package
23+
- name: Windows
24+
os: windows-latest
25+
copy: mkdir package && copy res package/ && copy config package/ && copy target\\release\\*.exe package
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Build
29+
run: cargo build --release
30+
- name: Copy executables
31+
run: ${{ matrix.copy }}
32+
- name: Pack
33+
uses: papeloto/action-zip@v1
34+
with:
35+
files: package
36+
dest: vangers-${{ matrix.os }}.zip
37+
recursive: true
38+
- name: Upload builds
39+
uses: svenstaro/upload-release-action@v2
40+
with:
41+
repo_token: ${{ secrets.GITHUB_TOKEN }}
42+
prerelease: true
43+
file: vangers-${{ matrix.os }}.zip
44+
tag: ${{ github.ref }}

Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ members = [
1414
"lib/tiff",
1515
]
1616

17-
[profile.release]
18-
debug = true
19-
2017
[lib]
2118

2219
[features]

config/settings-linux-3rdperson.ron

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
(
2+
data_path: "/Applications/Gog/Vangers.app/Contents/Resources/game",
3+
game: (
4+
level: "Fostral", // see `wrlds.dat` for the list
5+
cycle: "Eleerection", // see `bunches.prm` for the list, leave empty for bonus worlds
6+
view: Perspective, // can be "Flat" or "Perspective"
7+
camera: (
8+
angle: 15,
9+
height: 15,
10+
target_overhead: 3,
11+
speed: 5,
12+
depth_range: (10, 400),
13+
fog_depth: 50,
14+
),
15+
other: (
16+
count: 10, // number of NPC vangers
17+
spawn_at: Random, // Player
18+
),
19+
physics: (
20+
max_quant: 0.1,
21+
shape_sampling: 1,
22+
gpu_collision: None/*Some(( // blocked by atomics
23+
max_objects: 100,
24+
max_polygons_total: 1000,
25+
max_raster_size: (100, 100),
26+
))*/,
27+
),
28+
),
29+
car: (
30+
id: "OxidizeMonk",
31+
//example: "IronShadow"
32+
color: Green, // Dummy, Red, Blue, Yellow, Gray
33+
slots: [],
34+
//example: ["HeavyLaser", "LightMissile", "LightFireBall"]
35+
),
36+
window: (
37+
title: "Rusty Road",
38+
size: (2280, 1800),
39+
reload_on_focus: true,
40+
),
41+
backend: Auto, // Vulkan, Metal, DX12, DX11
42+
render: (
43+
light: (
44+
pos: (1, 4, 4, 0), // w=0 for directional, w=1 for point light
45+
color: (1, 1, 1, 1),
46+
shadow: (
47+
size: 1024,
48+
terrain: RayTraced,
49+
),
50+
),
51+
fog: (
52+
color: (0.1, 0.2, 0.3, 1.0),
53+
depth: 50,
54+
),
55+
terrain:
56+
// RayTraced,
57+
// RayMipTraced (mip_count: 10, max_jumps: 25, max_steps: 100, debug: false),
58+
// Scattered( density: (2, 2, 2) ), // blocked by NumWorkgroups builtin
59+
// Sliced,
60+
Painted,
61+
debug: (
62+
max_vertices: 512,
63+
collision_shapes: false,
64+
collision_map: false,
65+
impulses: false,
66+
),
67+
),
68+
)

src/config/settings.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,27 @@ impl Settings {
159159
pub fn load(path: &str) -> Self {
160160
use std::io::Read;
161161

162+
const TEMPLATE: &str = "config/settings.template.ron";
163+
const PATH: &str = "config/settings.ron";
162164
let mut string = String::new();
163165
File::open(path)
164-
.expect("Unable to open the settings file")
166+
.unwrap_or_else(|e| panic!("Unable to open the settings file: {:?}.\nPlease copy '{}' to '{}' and adjust 'data_path'",
167+
e, TEMPLATE, PATH))
165168
.read_to_string(&mut string)
166169
.unwrap();
167170
let set: Settings = match ron::de::from_str(&string) {
168171
Ok(set) => set,
169-
Err(e) => panic!("Unable to parse settings RON.\n\t{}\n\tError: {:?}",
170-
"Please check if `config/settings.template.ron` has changed and your local config needs to be adjusted.",
172+
Err(e) => panic!(
173+
"Unable to parse settings RON: {:?}.\nPlease check if `{}` has changed and your local config needs to be adjusted.",
171174
e,
175+
TEMPLATE,
172176
),
173177
};
174178

175179
if !set.check_path("options.dat") {
176180
panic!(
177-
"Can't find the resources of the original Vangers game at {:?}, {}",
178-
set.data_path, "please check your `config/settings.ron`"
181+
"Can't find the resources of the original Vangers game at {:?}, please check your `{}`",
182+
set.data_path, PATH,
179183
);
180184
}
181185

0 commit comments

Comments
 (0)