tauri/.github/workflows/build-smoke-tests.yml
Jacob Bolda 6424b00ca7
feat: build tauri communication app on demand (#1001)
* feat: build tauri communication app on demand

* add run command

* manually set defaults, build tauri.js

* add script defaults and options

* run command doesn't need the `yarn` and `build`

* try just build?

* empty script

* just skip it for now

* try fix on fix/paths-expect-arrays branch

* add tauri as script

* use nested folders

* enable on pr again

* switch to preferGlobal

* skip install

* build without action

* flip global

* list

* add yarn bin to path

* now try with action

* extra spaces

* prepare for release

* don't run on pr
2020-09-02 11:57:28 -05:00

97 lines
3.0 KiB
YAML

name: build smoke test with source
on:
workflow_dispatch:
inputs:
repository:
description: 'Repository from which to pull and create a Tauri app.'
required: false
default: 'tauri-apps/tauri'
ref:
description: 'Branch or ref to pull down.'
required: false
default: 'dev'
dir:
description: 'Directory we expect to run in.'
required: false
default: 'tauri/examples/communication'
buildAssets:
description: 'Command to build the assets.'
required: false
default: 'echo no build needed'
buildTauri:
description: 'Command to build the Tauri app.'
required: false
default: 'tauri'
env:
RUST_BACKTRACE: 1
jobs:
create-and-upload-assets:
runs-on: ${{ matrix.platform }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
include:
- platform: ubuntu-latest
releaseFolder: target/release/bundle/deb
- platform: macos-latest
releaseFolder: target/release/bundle/osx
- platform: windows-latest
releaseFolder: target/release/bundle/msi
steps:
- uses: actions/checkout@v2
with:
path: tauri
- uses: actions/checkout@v2
with:
repository: ${{ github.event.inputs.repository }}
ref: ${{ github.event.inputs.ref }}
path: example
- name: setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: install rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: install webkit2gtk (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- name: yarn install for cli
working-directory: tauri/cli/tauri.js
run: yarn
- name: build tauri.js
working-directory: tauri/cli/tauri.js
run: |
yarn build-release
yarn global add $PWD
echo "::add-path::$(yarn global bin)"
- name: install and build assets
working-directory: 'example/${{ github.event.inputs.dir }}'
run: ${{ github.event.inputs.buildAssets }}
- name: cargo install tauri-bundler --force
working-directory: tauri/cli/tauri-bundler
run: cargo install tauri-bundler --path . --force
- name: build tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
includeDebug: true
projectPath: 'example/${{ github.event.inputs.dir }}'
preferGlobal: true
- uses: actions/upload-artifact@v2
if: success()
with:
name: tauri-app.${{ matrix.platform }}
path: ${{ format('./{0}{1}/src-tauri/{2}/**', 'example/', github.event.inputs.dir, matrix.releaseFolder ) }}