tauri/.github/workflows/build-smoke-tests.yml
Noah Klayman 1d66d00506
chore: improve contributor experience (#1264)
* chore: update install commands in setup scripts

* chore(examples/api): add `tauri` script

* chore(contributing.md): update to match new developments

* fix(scripts/setup): typo

* chore(examples): replace communication with helloworld

* remove deno submodule as it was added on accident

* fix(examples/helloword): add __tauri.js to .gitignore

* fix(examples): helloworld example with `cargo run`, change dev path

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
2021-02-21 08:48:08 -08:00

94 lines
2.8 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/helloworld"
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: 14
- 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: 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 ) }}