Compare commits
6 Commits
0892415ab9
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
| dab05cf6c8 | |||
| b74831cdff | |||
| 4e58d9a50e | |||
| afde731409 | |||
| 8086bb586c | |||
| f3f0d74fec |
@@ -8,13 +8,15 @@ jobs:
|
||||
steps:
|
||||
- name: Update
|
||||
run: |
|
||||
cat /etc/apt/sources.list
|
||||
# TODO : Add from previous file
|
||||
sudo apt-get update -y -qq || true
|
||||
sudo apt-get install -y build-essential git make zip libsdl2-dev libsdl2-2.0-0 libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-ttf-dev gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu libssl-dev
|
||||
sudo apt-get install -y build-essential git make zip libsdl2-dev libsdl2-2.0-0 libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-gfx-dev libsdl2-ttf-dev gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
|
||||
#ARM64
|
||||
#sudo apt install -y libssl-dev:arm64 libasound2-dev:arm64
|
||||
sudo sh -c "echo '192.168.1.253 descartes.local' >> /etc/hosts"
|
||||
sudo sh -c "echo '192.168.1.253 build.ladose.net' >> /etc/hosts"
|
||||
sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
sudo -E $HOME/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
|
||||
|
||||
- name: GetDNS
|
||||
run: |
|
||||
@@ -28,18 +30,19 @@ jobs:
|
||||
run: |
|
||||
. "$HOME/.cargo/env"
|
||||
cargo build --release
|
||||
cargo build --release --target=aarch64-unknown-linux-gnu
|
||||
- name: Zip file
|
||||
run: |
|
||||
zip -rj build.zip ./target/release/
|
||||
zip -rj build-Aarch64.zip ./target/release/
|
||||
zip -rj build.zip ./target/release/ladose-caller ./font/
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: build-linux64.zip
|
||||
name: build-linux64.zip
|
||||
path: build.zip
|
||||
name: build.zip
|
||||
retention-days: 30
|
||||
overwrite: true
|
||||
- name: Get current date
|
||||
id: date
|
||||
run: echo "date=$(echo $(date +'%Y-%m-%d'))" >> $GITHUB_OUTPUT
|
||||
- name: Release
|
||||
if: github.ref_name == 'master'
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
@@ -47,6 +50,5 @@ jobs:
|
||||
with:
|
||||
tag_name: release-${{ steps.date.outputs.date }}
|
||||
files: |-
|
||||
build-winx64.zip
|
||||
build-linux64.zip
|
||||
build.zip
|
||||
|
||||
|
||||
10
Cargo.lock
generated
10
Cargo.lock
generated
@@ -107,6 +107,15 @@ version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
|
||||
|
||||
[[package]]
|
||||
name = "cmake"
|
||||
version = "0.1.54"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cynic"
|
||||
version = "3.10.0"
|
||||
@@ -1065,6 +1074,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "951deab27af08ed9c6068b7b0d05a93c91f0a8eb16b6b816a5e73452a43521d3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cmake",
|
||||
"libc",
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
@@ -16,4 +16,5 @@ cynic-codegen = { version = "3" }
|
||||
[dependencies.sdl2]
|
||||
version = "0.37"
|
||||
default-features = false
|
||||
features = ["ttf","image","gfx","mixer"]
|
||||
features = ["ttf","image","gfx"]
|
||||
|
||||
|
||||
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM rust:latest
|
||||
|
||||
RUN dpkg --add-architecture arm64
|
||||
RUN apt update && apt upgrade -y
|
||||
RUN apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross
|
||||
RUN apt-get install -y libsdl2-dev:arm64 libsdl2-2.0-0:arm64 libsdl2-net-dev:arm64 libsdl2-mixer-dev:arm64 libsdl2-image-dev:arm64 libsdl2-gfx-dev:arm64 libsdl2-ttf-dev:arm64
|
||||
RUN rustup target add aarch64-unknown-linux-gnu
|
||||
RUN rustup toolchain add stable-aarch64-unknown-linux-gnu --force-non-host
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
|
||||
|
||||
CMD ["cargo", "build", "--target", "aarch64-unknown-linux-gnu","-r"]
|
||||
12
buildaarch64.sh
Executable file
12
buildaarch64.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
echo "build podman image"
|
||||
podman build . -t cross_compile/rust_aarch64
|
||||
echo "run build"
|
||||
podman run --rm -v .:/app cross_compile/rust_aarch64
|
||||
|
||||
|
||||
ssh tom@raspberrypi.local -f 'sudo systemctl stop lightdm'
|
||||
ssh tom@raspberrypi.local -f 'killall ladose-caller'
|
||||
scp ./target/aarch64-unknown-linux-gnu/release/ladose-caller tom@raspberrypi.local:
|
||||
|
||||
ssh tom@raspberrypi.local -f 'sudo systemctl start lightdm'
|
||||
9
config.toml
Normal file
9
config.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
tournament = 'tournoi-kiouze-test'
|
||||
update = 2
|
||||
fullscreen = true
|
||||
font_size = 40
|
||||
font_size_departure = 60
|
||||
smash_key = 'Bearer API_KEY'
|
||||
margin = 10
|
||||
w = 1920
|
||||
h = 1080
|
||||
@@ -19,6 +19,8 @@ use serde::Deserialize;
|
||||
#[derive(Deserialize,Clone)]
|
||||
pub struct Config {
|
||||
tournament: String,
|
||||
w : u32,
|
||||
h : u32,
|
||||
update: Option<u32>,
|
||||
fullscreen: Option<bool>,
|
||||
smash_key: String,
|
||||
@@ -40,7 +42,7 @@ struct Line<'a> {
|
||||
|
||||
impl Config {
|
||||
fn new() -> Self {
|
||||
Self { tournament: String::new(), update: Some(1),fullscreen:Some(false), smash_key: String::new(), font_size: 30 , font_size_departure : 45, margin: 10,tournament_image: None }
|
||||
Self { tournament: String::new(), update: Some(1),fullscreen:Some(false), smash_key: String::new(), font_size: 30 , font_size_departure : 45, margin: 10,tournament_image: None , w : 1920, h: 1080}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +161,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let sdl_context = sdl2::init().unwrap();
|
||||
let video_subsystem = sdl_context.video().unwrap();
|
||||
|
||||
let mut build = video_subsystem.window("LaDOSE-SNCF", 1280, 720);
|
||||
let mut build = video_subsystem.window("LaDOSE-SNCF", box_config.w, box_config.h);
|
||||
if fullscreen {
|
||||
build.fullscreen();
|
||||
}
|
||||
@@ -217,6 +219,6 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
|
||||
canvas.present();
|
||||
::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 60));
|
||||
::std::thread::sleep(Duration::new(0, 1_000_000_000u32 / 30));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user