Skip to content

Commit

Permalink
111
Browse files Browse the repository at this point in the history
  • Loading branch information
zanllp committed Aug 21, 2024
1 parent e3d4533 commit 22339bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 127 deletions.
127 changes: 1 addition & 126 deletions .github/workflows/tauri_app_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,126 +54,11 @@ jobs:
out/iib_api_server.exe
out/iib_api_server
- run: mv out/iib_api_server.exe vue/src-tauri/iib_api_server-x86_64-pc-windows-msvc.exe
if: matrix.os == 'windows-latest'

- run: mv out/iib_api_server vue/src-tauri/iib_api_server-x86_64-unknown-linux-gnu
if: matrix.os == 'ubuntu-20.04'

- name: Install frontend dependencies
run: yarn install
working-directory: vue

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './vue/src-tauri -> target'

- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Build the app
run: |
yarn tauri-build
working-directory: vue


- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: bundle-${{ env.VERSION }}-${{ runner.os }}
path: |
vue/src-tauri/target/release/bundle/nsis/Infinite Image Browsing_${{ env.VERSION }}_x64-setup.exe
vue/src-tauri/target/release/bundle/deb/infinite-image-browsing_${{ env.VERSION }}_amd64.deb
build-by-pyinstaller:
strategy:
matrix:
os: [windows-latest]

runs-on: ${{ matrix.os }}

permissions:
contents: write
steps:
- name: Check-out repository
uses: actions/checkout@v3

- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> $env:GITHUB_ENV

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
pip install -r requirements.txt
- uses: sayyid5416/pyinstaller@v1
with:
spec: 'app.py'
upload_exe_with_name: 'My executable'
options: --onefile

- run: mv dist/app.exe vue/src-tauri/iib_api_server-x86_64-pc-windows-msvc.exe

- name: Install frontend dependencies
run: yarn install
working-directory: vue

- name: Rust setup
uses: dtolnay/rust-toolchain@stable

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './vue/src-tauri -> target'

- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Build the app
run: |
yarn tauri-build
working-directory: vue

- run: |
cd vue/src-tauri/target/release/bundle/nsis
mv "Infinite Image Browsing_${{ env.VERSION }}_x64-setup.exe" "Infinite Image Browsing_${{ env.VERSION }}_x64-setup-pyinstaller.exe"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: bundle-${{ env.VERSION }}-${{ runner.os }}
path: |
vue/src-tauri/target/release/bundle/nsis/Infinite Image Browsing_${{ env.VERSION }}_x64-setup-pyinstaller.exe
release:
needs: [build-by-pyinstaller, build]
needs: [ build]
runs-on: ubuntu-latest

permissions:
Expand All @@ -188,16 +73,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v3
with:
name: bundle-${{ env.VERSION }}-Windows
path: artifacts

- uses: actions/download-artifact@v3
with:
name: bundle-${{ env.VERSION }}-Linux
path: artifacts

- uses: actions/download-artifact@v3
with:
name: iib_api_server-${{ env.VERSION }}-Windows
Expand Down
2 changes: 1 addition & 1 deletion scripts/iib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
except Exception as e:
logger.error(e)

print(f"data_file_path:{get_data_file_path("")}")
print(f"data_file_path:{get_data_file_path('')}")

index_html_path = get_data_file_path("vue/dist/index.html") if is_exe_ver else os.path.join(cwd, "vue/dist/index.html") # 在app.py也被使用

Expand Down

0 comments on commit 22339bd

Please sign in to comment.