Skip to content

Commit 4b143be

Browse files
committed
Moved compiled style into the OUT directory, because cargo is complaining
1 parent 8b58ea8 commit 4b143be

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

.github/workflows/release.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828
2929
- name: Find Executable
3030
run: |
31-
find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -exec echo binary={} \; >> "$GITHUB_ENV"
31+
find target/${{ matrix.target }}/release -maxdepth 1 -type f -executable -exec echo binary={} \; -quit >> "$GITHUB_ENV"
32+
33+
- name: Find Style
34+
run: |
35+
find target/${{ matrix.target }}/release -type f -name '*.css' -exec echo style={} \; -quit >> "$GITHUB_ENV"
3236
3337
- name: Patch ELF
3438
run: |
@@ -41,6 +45,14 @@ jobs:
4145
run: |
4246
md5sum -b ${{ env.binary }} | head -c 32
4347
48+
- name: Upload Style
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: default.css
52+
path: ${{ env.style }}
53+
if-no-files-found: error
54+
overwrite: false
55+
4456
- name: Upload Artifact
4557
uses: actions/upload-artifact@v4
4658
with:

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
/style/default.css
21
/target

build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ fn compile_style() -> Result<()> {
3030
use grass::*;
3131

3232
let source = "style/default.scss";
33-
let destination = "style/default.css";
33+
let destination = format!("{}/default.css", std::env::var("OUT_DIR").unwrap());
3434

3535
let source_mtime = fs::metadata(source)?.modified()?;
3636

37-
if let Ok(destination_meta) = fs::metadata(destination) {
37+
if let Ok(destination_meta) = fs::metadata(&destination) {
3838
if Some(source_mtime) == destination_meta.modified().ok() {
3939
return Ok(())
4040
}

src/style.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub async fn find(path: impl Into<PathBuf>, settings: StyleSettings) -> Result<C
5656

5757
#[allow(unused_variables)]
5858
pub async fn default(settings: StyleSettings) -> Cow<'static, str> {
59-
static DEFAULT_STYLE: &str = include_str!("../style/default.css");
59+
static DEFAULT_STYLE: &str = include_str!(concat!(env!("OUT_DIR"), "/default.css"));
6060

6161
#[cfg(feature = "Accent")]
6262
if settings.accent {

0 commit comments

Comments
 (0)