1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-06 06:02:40 +03:00

ci: fix the dist build assets path

This commit is contained in:
Quentin Gliech
2023-07-25 11:49:36 +02:00
parent 0421ba638e
commit 7bf6777a90
7 changed files with 39 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ jobs:
- name: Build policies - name: Build policies
working-directory: ./policies working-directory: ./policies
run: make build run: make
- name: Collect the artifacts - name: Collect the artifacts
run: | run: |
@@ -90,7 +90,13 @@ jobs:
run: pip3 install ziglang==0.9.1 cargo-zigbuild==0.16.12 run: pip3 install ziglang==0.9.1 cargo-zigbuild==0.16.12
- name: Build the binary - name: Build the binary
run: cargo zigbuild --release --target=${{ matrix.arch }}-unknown-linux-musl -p mas-cli run: >
cargo zigbuild
--release
--target=${{ matrix.arch }}-unknown-linux-musl
--no-default-features
--features dist
-p mas-cli
- name: Download the artifacts - name: Download the artifacts
uses: actions/download-artifact@v3.1.2 uses: actions/download-artifact@v3.1.2

View File

@@ -70,6 +70,9 @@ indoc = "2.0.3"
[features] [features]
default = ["jaeger", "zipkin", "webpki-roots", "policy-cache"] default = ["jaeger", "zipkin", "webpki-roots", "policy-cache"]
# Features used for the prebuilt binaries
dist = ["otlp", "jaeger", "zipkin", "prometheus", "policy-cache", "native-roots", "mas-config/dist"]
# Features used in the Docker image # Features used in the Docker image
docker = ["otlp", "jaeger", "zipkin", "prometheus", "native-roots", "mas-config/docker"] docker = ["otlp", "jaeger", "zipkin", "prometheus", "native-roots", "mas-config/docker"]

View File

@@ -37,6 +37,7 @@ mas-iana = { path = "../iana" }
[features] [features]
docker = [] docker = []
dist = []
[[bin]] [[bin]]
name = "schema" name = "schema"

View File

@@ -24,6 +24,9 @@
//! Application configuration logic //! Application configuration logic
#[cfg(all(feature = "docker", feature = "dist"))]
compile_error!("Only one of the `docker` and `dist` features can be enabled at once");
pub(crate) mod schema; pub(crate) mod schema;
mod sections; mod sections;
pub(crate) mod util; pub(crate) mod util;

View File

@@ -45,7 +45,7 @@ fn http_address_example_4() -> &'static str {
"0.0.0.0:8080" "0.0.0.0:8080"
} }
#[cfg(not(feature = "docker"))] #[cfg(not(any(feature = "docker", feature = "dist")))]
fn http_listener_assets_path_default() -> Utf8PathBuf { fn http_listener_assets_path_default() -> Utf8PathBuf {
"./frontend/dist/".into() "./frontend/dist/".into()
} }
@@ -55,6 +55,11 @@ fn http_listener_assets_path_default() -> Utf8PathBuf {
"/usr/local/share/mas-cli/assets/".into() "/usr/local/share/mas-cli/assets/".into()
} }
#[cfg(feature = "dist")]
fn http_listener_assets_path_default() -> Utf8PathBuf {
"./share/assets/".into()
}
/// Kind of socket /// Kind of socket
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone, Copy)] #[derive(Debug, Serialize, Deserialize, JsonSchema, Clone, Copy)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]

View File

@@ -21,7 +21,7 @@ use serde_with::serde_as;
use super::ConfigurationSection; use super::ConfigurationSection;
#[cfg(not(feature = "docker"))] #[cfg(not(any(feature = "docker", feature = "dist")))]
fn default_policy_path() -> Utf8PathBuf { fn default_policy_path() -> Utf8PathBuf {
"./policies/policy.wasm".into() "./policies/policy.wasm".into()
} }
@@ -31,6 +31,11 @@ fn default_policy_path() -> Utf8PathBuf {
"/usr/local/share/mas-cli/policy.wasm".into() "/usr/local/share/mas-cli/policy.wasm".into()
} }
#[cfg(feature = "dist")]
fn default_policy_path() -> Utf8PathBuf {
"./share/policy.wasm".into()
}
fn default_client_registration_endpoint() -> String { fn default_client_registration_endpoint() -> String {
"client_registration/violation".to_owned() "client_registration/violation".to_owned()
} }

View File

@@ -20,7 +20,7 @@ use serde::{Deserialize, Serialize};
use super::ConfigurationSection; use super::ConfigurationSection;
#[cfg(not(feature = "docker"))] #[cfg(not(any(feature = "docker", feature = "dist")))]
fn default_path() -> Utf8PathBuf { fn default_path() -> Utf8PathBuf {
"./templates/".into() "./templates/".into()
} }
@@ -30,7 +30,12 @@ fn default_path() -> Utf8PathBuf {
"/usr/local/share/mas-cli/templates/".into() "/usr/local/share/mas-cli/templates/".into()
} }
#[cfg(not(feature = "docker"))] #[cfg(feature = "dist")]
fn default_path() -> Utf8PathBuf {
"./share/templates/".into()
}
#[cfg(not(any(feature = "docker", feature = "dist")))]
fn default_assets_path() -> Utf8PathBuf { fn default_assets_path() -> Utf8PathBuf {
"./frontend/dist/manifest.json".into() "./frontend/dist/manifest.json".into()
} }
@@ -40,6 +45,11 @@ fn default_assets_path() -> Utf8PathBuf {
"/usr/local/share/mas-cli/manifest.json".into() "/usr/local/share/mas-cli/manifest.json".into()
} }
#[cfg(feature = "dist")]
fn default_assets_path() -> Utf8PathBuf {
"./share/manifest.json".into()
}
/// Configuration related to templates /// Configuration related to templates
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)] #[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
pub struct TemplatesConfig { pub struct TemplatesConfig {