diff --git a/.github/workflows/build-cross.yml b/.github/workflows/build-cross.yml deleted file mode 100644 index 43fcd69..0000000 --- a/.github/workflows/build-cross.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Build cross binary - -on: - push: - tags-ignore: - - test** - pull_request: - -jobs: - build_aarch64: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: aarch64-unknown-linux-musl - override: true - - name: Build aarch 64 binary - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: build - args: --target aarch64-unknown-linux-musl --release - - run: mv target/aarch64-unknown-linux-musl/release/static-fs target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64 - - uses: actions/upload-artifact@v2 - with: - name: aarch64-artifact - path: target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fefd20c..58c2100 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,19 +15,65 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + + # Build amd64 gnu + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-gnu + override: true + - name: Build x64 gnu + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target x86_64-unknown-linux-gnu --release + # Done amd64 gnu + + # Build amd64 musl + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-unknown-linux-musl + override: true + - name: Build x64 musl + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target x86_64-unknown-linux-musl --release + # Done amd64 musl + + # Build arm64 musl - uses: actions-rs/toolchain@v1 with: toolchain: stable target: aarch64-unknown-linux-musl override: true - - name: Build aarch 64 binary + - name: Build aarch64 musl uses: actions-rs/cargo@v1 with: use-cross: true command: build args: --target aarch64-unknown-linux-musl --release - - run: mv target/aarch64-unknown-linux-musl/release/static-fs target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64 - - uses: actions/upload-artifact@v2 + # Done arm64 musl + + # Create release + - name: Generate release tag + id: tag + run: | + echo "::set-output name=release_tag::ActionBuild_$(date +"%Y.%m.%d_%H-%M-%S")" + - name: Move files + run: | + mv ./target/aarch64-unknown-linux-musl/release/static-fs ./static-fs-linux-musl-aarch64 + mv ./target/x86_64-unknown-linux-musl/release/static-fs ./static-fs-linux-musl-amd64 + mv ./target/x86_64-unknown-linux-gnu/release/static-fs ./static-fs-linux-gnu-amd64 + - name: Release + uses: softprops/action-gh-release@v1 with: - name: aarch64-artifact - path: target/aarch64-unknown-linux-musl/release/static-fs-linux-musl-aarch64 + tag_name: ${{ steps.tag.outputs.release_tag }} + files: | + ./static-fs-linux-musl-aarch64 + ./static-fs-linux-musl-amd64 + ./static-fs-linux-gnu-amd64 + # Done release diff --git a/README.md b/README.md index 448e69c..4c8488b 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ Rust static file serve. It is suitable for serving static built of Single Page Applications (SPA) # Usage ``` -./static-fs-linux-gnu :8080 -./static-fs-linux-gnu 127.0.0.1:8080 -./static-fs-linux-gnu unix:/tmp/http.sock -./static-fs-linux-gnu unix:/tmp/http.sock /opt/build/public +./static-fs-linux-gnu -b :8080 +./static-fs-linux-gnu -b 127.0.0.1:8080 +./static-fs-linux-gnu -b unix:/tmp/http.sock +./static-fs-linux-gnu -b unix:/tmp/http.sock -f /opt/build/public ``` # Build ```