Skip to content

Commit 1d9a760

Browse files
committed
fix: release action
1 parent 4b69927 commit 1d9a760

File tree

8 files changed

+34
-8
lines changed

8 files changed

+34
-8
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,20 @@ jobs:
3030
with:
3131
targets: wasm32-unknown-unknown
3232

33+
- name: Setup Cargo Binstall
34+
uses: cargo-bins/cargo-binstall@main
35+
36+
- name: Install Rust Binaries
37+
run: |
38+
cargo binstall -y --force cargo-edit
39+
cargo binstall -y --force leptosfmt
40+
cargo binstall -y --force trunk
41+
42+
- name: Build (debug)
43+
run: make build
44+
3345
- name: publish crate
34-
run: cargo publish -p http-server --dry-run
46+
run: cargo publish -p http-server --dry-run --allow-dirty
3547

3648
release:
3749
name: Create Release
@@ -78,7 +90,7 @@ jobs:
7890
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
7991

8092
- name: Publish crate
81-
run: cargo publish -p http-server
93+
run: cargo publish -p http-server --allow-dirty
8294

8395
- name: Create Release
8496
id: create_release

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#######################
77
/target
88
/tmp
9+
/src/http-server/ui/*
10+
!/src/http-server/ui/.gitkeep
911

1012
# Compiled source #
1113
###################

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
default: release
44

5-
release: ui-build
5+
build:
6+
make -C ./src/file-explorer-ui dist
7+
make -C ./src/http-server build
8+
9+
release:
10+
make -C ./src/file-explorer-ui release
611
make -C ./src/http-server release
712

813
run:

src/file-explorer-ui/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dist:
1111

1212
fmt:
1313
@leptosfmt --version >/dev/null 2>&1 || (echo "Error: leptosfmt is required."; exit 1)
14-
leptosfmt ./src/**/*.rs
14+
@leptosfmt ./src/**/*.rs
1515

1616
release:
1717
trunk build --release --locked --config ./Trunk.toml

src/file-explorer-ui/Trunk.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build]
22
# The index HTML file to drive the bundling process.
33
target = "./public/index.html"
4+
dist = "../http-server/ui"
45

56
[watch]
67
# Paths to watch. The `build.target`'s parent folder is watched by default.

src/http-server/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
[package]
22
name = "http-server"
33
version = "0.8.9"
4-
authors = ["Esteban Borai <estebanborai@gmail.com>"]
4+
authors = ["Leo Borai <estebanborai@gmail.com>"]
55
edition = "2021"
66
description = "Simple and configurable command-line HTTP server"
77
repository = "https://github.com/http-server-rs/http-server"
88
categories = ["web-programming", "web-programming::http-server"]
99
keywords = ["configurable", "http", "server", "serve", "static"]
1010
license = "MIT OR Apache-2.0"
11-
readme = "README.md"
11+
readme = "../../README.md"
12+
include = ["/ui", "/src/"]
1213

13-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
14+
[[bin]]
15+
name = "http-server"
16+
path = "src/main.rs"
1417

1518
[dependencies]
1619
anyhow = { workspace = true }

src/http-server/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
default:
44
cargo r -- start
55

6+
build:
7+
cargo b
8+
69
release:
710
cargo b --release
811

src/http-server/src/handler/file_explorer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use self::proto::BreadcrumbItem;
2222
use self::utils::{decode_uri, encode_uri, PERCENT_ENCODE_SET};
2323

2424
#[derive(Embed)]
25-
#[folder = "../file-explorer-ui/dist"]
25+
#[folder = "./ui"]
2626
struct FileExplorerAssets;
2727

2828
pub struct FileExplorer {

0 commit comments

Comments
 (0)