mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-04 20:37:43 +00:00
feat: add build-rustfs-gui process and optimize utils/helper.rs
1. Added a new build process `build-rustfs-gui` in `build.yaml` to streamline the build operations for the RustFS GUI. 2. Optimized `cli/rustfs-gui/utils/helper.rs` by using `rust-embed` to embed the `rustfs` resources directly into the binary.
This commit is contained in:
@@ -7,6 +7,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags: [ 'v*', '*' ]
|
||||
|
||||
jobs:
|
||||
build-rustfs:
|
||||
@@ -60,9 +61,12 @@ jobs:
|
||||
# Create package
|
||||
mkdir -p ${ARTIFACT_NAME}
|
||||
cp "$bin_path" ${ARTIFACT_NAME}/rustfs
|
||||
# cp -r static ${ARTIFACT_NAME}/
|
||||
zip -r ${ARTIFACT_NAME}.zip ${ARTIFACT_NAME}
|
||||
ls -la
|
||||
|
||||
# Copy files to the specified directory
|
||||
mkdir -p cli/rustfs-gui/embedded-rustfs
|
||||
cp -r ${ARTIFACT_NAME}/rustfs cli/rustfs-gui/embedded-rustfs/
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -70,9 +74,40 @@ jobs:
|
||||
path: ${{ steps.package.outputs.artifact_name }}.zip
|
||||
retention-days: 7
|
||||
|
||||
merge:
|
||||
build-rustfs-gui:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-rustfs
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install dioxus-cli
|
||||
run: cargo install dioxus-cli
|
||||
|
||||
- name: Build and Bundle rustfs-gui
|
||||
run: |
|
||||
relaese_path = "target/${{ matrix.variant.target }}"
|
||||
mkdir -p ${relaese_path}
|
||||
cd cli/rustfs-gui
|
||||
if [[ "${{ matrix.variant.target }}" == *"apple-darwin"* ]]; then
|
||||
dx bundle --platform macos --package-types "macos" --package-types "dmg" --package-types "ios" --release --profile release --out-dir ../../${relaese_path}
|
||||
elif [[ "${{ matrix.variant.target }}" == *"windows-msvc"* ]]; then
|
||||
dx bundle --platform windows --package-types "msi" --release --profile release --out-dir ../../target/${relaese_path}
|
||||
fi
|
||||
cd ../..
|
||||
GUI_ARTIFACT_NAME="rustfs-gui-${{ matrix.variant.profile }}-${{ matrix.variant.target }}"
|
||||
zip -r ${GUI_ARTIFACT_NAME}.zip target/${{ matrix.variant.target }}/rustfs-gui
|
||||
echo "gui_artifact_name=${GUI_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||
ls -la
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.package.outputs.gui_artifact_name }}
|
||||
path: ${{ steps.package.outputs.gui_artifact_name }}.zip
|
||||
retention-days: 7
|
||||
|
||||
merge:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build-rustfs, build-rustfs-gui ]
|
||||
steps:
|
||||
- uses: actions/upload-artifact/merge@v4
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user