]> git.puffer.fish Git - matthieu/nova.git/commitdiff
fix builds
authorMatthieuCoder <matthieu@matthieu-dev.xyz>
Tue, 3 Jan 2023 11:19:10 +0000 (15:19 +0400)
committerMatthieuCoder <matthieu@matthieu-dev.xyz>
Tue, 3 Jan 2023 11:19:10 +0000 (15:19 +0400)
.github/workflows/build.yml
libs/leash/src/lib.rs

index 2c1c3b29ad880987ac137ed78efb28bf7291c555..30b118f91fd1af8dc9b833a061ca0b3aeb530e62 100644 (file)
@@ -50,8 +50,6 @@ jobs:
           - macOS-latest
         rust:
           - stable
-          - beta
-          - nightly
     runs-on: ${{ matrix.os }}
     needs: [compile]
     steps:
@@ -64,6 +62,25 @@ jobs:
       - name: Setup | Rust
         uses: ATiltedTree/setup-rust@v1
         with:
-          rust-version: ${{ matrix.rust }}
+          rust-version: stable
+        - uses: actions/setup-go@v3
+          with:
+            go-version: '1.16.1' # The Go version to download (if necessary) and use.
       - name: Build | Compile
-        run: cargo test
+        run: cargo build --release
+      - name: Build | All in one
+        run:
+          - cd exes/all
+          - make build
+        shell: bash
+      - name: Finish | Prepare artifacts
+        run:
+          - mkdir -p artifacts
+          - cp target/release/{cache,gateway,webhook,ratelimit} ./artifacts
+          - cp exes/all/build/all ./artifacts
+        shell: bash
+      - name: Finish | Archive build results
+        uses: actions/upload-artifact@v3
+        with:
+          name: artifacts
+          path: artifacts/*
\ No newline at end of file
index 3dafdacbc03c6b3c3f839cbdc0bcf128c1b717a5..13e8258c5a065b19bcfa433bceabd1346299f020 100644 (file)
@@ -2,7 +2,6 @@ use anyhow::Result;
 use serde::de::DeserializeOwned;
 use shared::{
     config::Settings,
-    log::{error, info},
 };
 use std::{future::Future, pin::Pin};
 use tokio::{signal::unix::SignalKind, sync::oneshot};
@@ -32,21 +31,15 @@ pub trait Component: Send + Sync + 'static + Sized {
             tokio::spawn(async move {});
 
             tokio::spawn(async move {
-                match tokio::signal::unix::signal(SignalKind::terminate())
+                #[cfg(unix)]
+                tokio::signal::unix::signal(SignalKind::terminate())
                     .unwrap()
                     .recv()
-                    .await
-                {
-                    Some(()) => {
-                        info!("Stopping program.");
-
-                        stop.send(()).unwrap();
-                    }
-                    None => {
-                        error!("Unable to listen for shutdown signal");
-                        // we also shut down in case of error
-                    }
-                }
+                    .await;
+                #[cfg(not(unix))]
+                tokio::signal::ctrl_c().await;
+
+                stop.send(()).unwrap();
             });
             self.start(settings?, stop_channel).await
         })