partey_workadventure/.github/workflows/build-and-release-desktop.yml

105 lines
2.7 KiB
YAML
Raw Normal View History

2022-02-18 12:03:48 +01:00
name: Build & release desktop app
2022-02-18 11:49:53 +01:00
on:
push:
branches:
- master
- develop
pull_request:
release:
types: [created]
2022-02-18 23:55:40 +01:00
env:
YARN_CACHE_FOLDER: ~/.yarn
2022-02-18 11:49:53 +01:00
jobs:
build_on_linux:
2022-02-18 22:36:24 +01:00
name: "Build & release desktop app for ${{ matrix.os }}"
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
strategy:
matrix:
node-version: [14.x]
runtime: [ linux-x64, win-x64, osx-x64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
- runtime: osx-x64
os: macos-latest
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
- runtime: win-x64
os: windows-latest
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
runs-on: ${{ matrix.os }}
2022-02-18 11:49:53 +01:00
steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Setup NodeJS"
2022-02-18 22:36:24 +01:00
uses: actions/setup-node@v2
2022-02-18 11:49:53 +01:00
with:
2022-02-18 22:36:24 +01:00
node-version: ${{ matrix.node-version }}
2022-02-18 11:49:53 +01:00
2022-02-18 23:55:40 +01:00
- name: Caching
uses: actions/cache@v2
with:
path: |
${{ env.YARN_CACHE_FOLDER }}
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-
2022-02-20 20:44:55 +01:00
- name: "local-app: Install dependencies"
run: yarn install --froze-lockfile
working-directory: "desktop/local-app"
- name: "local-app: Build"
run: yarn build
working-directory: "desktop/local-app"
2022-02-18 11:49:53 +01:00
- name: "Install dependencies"
run: yarn install --froze-lockfile
working-directory: "desktop"
2022-02-18 22:36:24 +01:00
- name: "Build typescript"
2022-02-18 11:49:53 +01:00
run: yarn build
working-directory: "desktop"
2022-02-18 22:36:24 +01:00
- name: "Build app"
2022-02-18 12:02:41 +01:00
run: yarn bundle --publish never
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-02-18 11:49:53 +01:00
working-directory: "desktop"
if: ${{ github.event_name != 'release' }}
2022-02-18 22:36:24 +01:00
- name: "Build & publish App"
run: yarn release
2022-02-18 12:02:41 +01:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-02-18 11:49:53 +01:00
working-directory: "desktop"
if: ${{ github.event_name == 'release' }}
2022-02-18 22:36:24 +01:00
- name: Upload Linux .AppImage artifact
uses: actions/upload-artifact@v2
2022-02-18 22:52:49 +01:00
if: startsWith(matrix.os, 'ubuntu')
2022-02-18 11:49:53 +01:00
with:
2022-02-18 22:36:24 +01:00
name: workadventure-desktop-linux-x64.AppImage
2022-02-19 01:59:57 +01:00
path: desktop/build/workadventure-desktop-*-x86_64.AppImage
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
- name: Upload Windows .exe artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
with:
name: workadventure-desktop-win-x64.exe
2022-02-19 01:59:57 +01:00
path: desktop/build/workadventure-desktop-*.exe
2022-02-18 11:49:53 +01:00
2022-02-18 22:36:24 +01:00
- name: Upload MacOS .dmg artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
with:
name: workadventure-mac.dmg
2022-02-19 01:59:57 +01:00
path: desktop/build/workadventure-desktop-*.dmg