Skip to content

Commit

Permalink
Merge pull request #4 from Nadeem-05/main
Browse files Browse the repository at this point in the history
.
  • Loading branch information
Nadeem-05 authored May 28, 2024
2 parents 831b952 + 1d07bd6 commit 4e38ed6
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 'publish'

on:
push:
branches:
- release

jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: ''
- platform: 'windows-latest'
args: ''

runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
# Install appropriate targets on macOS only
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}

- name: Build Backend and rename
uses: actions/setup-python@v5
with:
python-version: '3.10'

- run: |
pip install flask flask-cors pyinstaller
pyinstaller -F src-tauri/py/app.py --distpath src-tauri/sidecars/ --onefile -n apps
shell: bash
- name: Rename script on Windows
if: runner.os == 'Windows'
run: python src-tauri/py/rename.py
shell: cmd

- name: Rename script on macOS and Linux
if: runner.os != 'Windows'
run: python3 src-tauri/py/rename.py
shell: bash

- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
# webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2.
# You can remove the one that doesn't apply to your app to speed up the workflow a bit.

- name: install frontend dependencies
run: npm run tauri build # change this to npm, pnpm or bun depending on which one you use.

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces __VERSION__ with the app version.
releaseName: 'App v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}

0 comments on commit 4e38ed6

Please sign in to comment.