Skip to content

Publish app

Publish app #770

Workflow file for this run

name: Publish app
on:
create:
env:
WTOOLS_AEAD_KEY: ${{ secrets.WTOOLS_AEAD_KEY }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
REMOTE_HOST: ${{ secrets.SERVER_IP }}
REMOTE_USER: ${{ secrets.USERNAME }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
jobs:
mw-toolbox:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
strategy:
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Prepare folders on update server
if: runner.os == 'Linux'
uses: appleboy/ssh-action@master
with:
host: ${{ env.REMOTE_HOST }}
username: ${{ env.REMOTE_USER }}
key: ${{ env.SSH_PRIVATE_KEY }}
script: |
cd ~/wwwcdn/releases/mw-toolbox/
rm -rf previous/
mv latest/ previous
mkdir -p latest/windows latest/linux latest/darwin
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev librsvg2-dev
# No need for caches for release builds, because they get cleared every week anyway.
- name: Install pnpm and project dependencies
uses: pnpm/action-setup@v2
with:
version: 8
run_install: |
- cwd: gui
- name: Build app
run: |
cd gui
pnpm tauri build
- name: Upload files to the update server (Windows)
if: runner.os == 'Windows'
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
with:
server: ${{ env.REMOTE_HOST }}
protocol: ftps
username: ftpuser
password: ${{ secrets.FTP_PASSWORD }}
local-dir: 'target/release/bundle/msi/'
server-dir: 'releases/mw-toolbox/latest/windows/x86_64'
- name: Upload files to the update server (Linux)
if: runner.os == 'Linux'
uses: easingthemes/ssh-deploy@main
with:
SOURCE: 'target/release/bundle/appimage/'
TARGET: '~/wwwcdn/releases/mw-toolbox/latest/linux/x86_64'
- name: Upload files to the update server (macOS)
if: runner.os == 'macOS'
uses: easingthemes/ssh-deploy@main
with:
SOURCE: 'target/release/bundle/macos/'
TARGET: '~/wwwcdn/releases/mw-toolbox/latest/darwin/x86_64'
- name: Upload release assets (Windows)
if: runner.os == 'Windows'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: target/release/bundle/msi/mw-toolbox_*.msi
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets (Linux)
if: runner.os == 'Linux'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: target/release/bundle/appimage/mw-toolbox_*.AppImage
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release assets (macOS)
if: runner.os == 'macOS'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: target/release/bundle/macos/mw-toolbox.app
token: ${{ secrets.GITHUB_TOKEN }}