Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.78.0
- uses: dtolnay/rust-toolchain@1.82.0
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: Build without default features
run: cargo build --no-default-features
- name: Run tests without default features
run: cargo test --no-default-features
run: cargo test --no-default-features --lib
- name: Build with change detection
run: cargo build --no-default-features --features change-detection
- name: Run tests with change detection
run: cargo test --no-default-features --features change-detection
- name: Build with all features
run: cargo build --all-features
publish:
name: Publish
if: startsWith( github.ref, 'refs/tags/v' )
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.78.0
- uses: dtolnay/rust-toolchain@1.82.0
- run: |
cargo publish --token ${CRATES_TOKEN}
env:
Expand Down
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@ name = "actix-web-static-files"
readme = "README.md"
repository = "https://github.com/kilork/actix-web-static-files"
version = "4.0.1"
rust-version = "1.78"
rust-version = "1.82"

[features]
default = [ "change-detection" ]
change-detection = [ "static-files/change-detection" ]
change-detection = [ "static-files/change-detection", "static-files-03?/change-detection" ]
static-files-03 = [ "dep:static-files-03" ]

[dependencies]
actix-web = { version = "4", default-features = false }
derive_more = "0.99.17"
futures-util = { version = "0.3", default-features = false, features = ["std"] }
static-files = { version = "0.2", default-features = false }

[build-dependencies]
static-files = { version = "0.2", default-features = false }
static-files-03 = { package = "static-files", version = "0.3", default-features = false, optional = true }
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static-files = "0.2.1"

Add `build.rs` with call to bundle resources:

```rust
```rust, no_run
use static_files::resource_dir;

fn main() -> std::io::Result<()> {
Expand All @@ -66,7 +66,7 @@ fn main() -> std::io::Result<()> {

Include generated code in `src/main.rs`:

```rust
```rust, ignore
use actix_web::{App, HttpServer};
use actix_web_static_files::ResourceFiles;

Expand Down Expand Up @@ -145,7 +145,7 @@ Add `dependencies` and `build-dependencies` in `Cargo.toml` same way as in the f

Add `build.rs` with call to bundle resources:

```rust
```rust, no_run
use static_files::npm_resource_dir;

fn main() -> std::io::Result<()> {
Expand Down Expand Up @@ -253,7 +253,7 @@ Add to `Cargo.toml` dependency to `actix-web-static-files` as in the first use c

Add `build.rs` with call to bundle resources:

```rust
```rust, no_run
use static_files::NpmBuild;

fn main() -> std::io::Result<()> {
Expand All @@ -269,7 +269,7 @@ fn main() -> std::io::Result<()> {

Include generated code in `src/main.rs`:

```rust
```rust, ignore
use actix_web::{App, HttpServer};
use actix_web_static_files;

Expand Down Expand Up @@ -332,7 +332,7 @@ See also:

We can use another package manager instead of `npm`. For example, to use [yarn](https://yarnpkg.com/) just add `.executable("yarn")` to `NpmBuild` call:

```rust
```rust, no_run
use static_files::NpmBuild;

fn main() -> std::io::Result<()> {
Expand All @@ -355,7 +355,7 @@ See also:

If you are using Angular as frontend, you may want to resolve all not found calls via `index.html` of frontend app. To do this just call method `resolve_not_found_to_root` after resource creation.

```rust
```rust, ignore
use actix_web::{middleware::Logger, App, HttpServer};
#[cfg(feature = "ui")]
use actix_web_static_files;
Expand Down
22 changes: 0 additions & 22 deletions build.rs

This file was deleted.

21 changes: 21 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,28 @@ if [ "${RELEASE_TYPE}" != "current" ]; then
cargo set-version --bump ${RELEASE_TYPE}
fi
VERSION=`cargo pkgid | cut -d"#" -f2`
export CRATE="actix-web-static-files"
export CRATE_RUST_MAJOR_VERSION=`echo ${VERSION} | cut -d"." -f1,2`
if [[ "${RELEASE_TYPE}" != "patch" && "${RELEASE_TYPE}" != "current" ]]; then
for example_repo in ../${CRATE}-examples ../${CRATE}-example-angular-router; do
pushd ${example_repo}
git checkout main
git pull
cargo upgrade -p ${CRATE}@${CRATE_RUST_MAJOR_VERSION}
cargo update
cargo build
popd
done
for example_repo in ../${CRATE}-examples ../${CRATE}-example-angular-router; do
pushd ${example_repo}
git add .
git commit -m"${CRATE} version ${CRATE_RUST_MAJOR_VERSION}"
git branch v${CRATE_RUST_MAJOR_VERSION}
git push
git push origin v${CRATE_RUST_MAJOR_VERSION}
popd
done
fi
handlebars-magic templates .
git add .
git commit -m"Release ${VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.78"
channel = "1.82"
profile = "minimal"
components = [ "rustfmt", "clippy", "rust-analyzer" ]
Loading