131 lines
3.6 KiB
YAML
131 lines
3.6 KiB
YAML
name: tauri_app_build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'releases/**'
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest,ubuntu-20.04]
|
|
|
|
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)" >> "$GITHUB_ENV"
|
|
if: matrix.os == 'ubuntu-20.04'
|
|
- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> $env:GITHUB_ENV
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
- 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
|
|
|
|
- name: Build Executable
|
|
uses: Nuitka/Nuitka-Action@main
|
|
with:
|
|
nuitka-version: main
|
|
script-name: app.py
|
|
output-file: iib_api_server
|
|
output-dir: out
|
|
|
|
- name: Upload Server Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: iib_api_server-${{ env.VERSION }}-${{ runner.os }}
|
|
path: |
|
|
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
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
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)" >> "$GITHUB_ENV"
|
|
|
|
- name: Delete drafts
|
|
uses: hugo19941994/delete-draft-releases@v1.0.0
|
|
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
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: true
|
|
tag_name: v${{ env.VERSION }}
|
|
files: artifacts/**/*
|
|
|