2021-04-11 01:09:09 +03:00
|
|
|
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2020-09-02 19:57:28 +03:00
|
|
|
name: build smoke test with source
|
2019-12-02 17:20:20 +03:00
|
|
|
|
2020-02-17 00:28:37 +03:00
|
|
|
on:
|
2020-09-02 19:57:28 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
repository:
|
2021-02-21 19:48:08 +03:00
|
|
|
description: "Repository from which to pull and create a Tauri app."
|
2020-09-02 19:57:28 +03:00
|
|
|
required: false
|
2021-02-21 19:48:08 +03:00
|
|
|
default: "tauri-apps/tauri"
|
2020-09-02 19:57:28 +03:00
|
|
|
ref:
|
2021-02-21 19:48:08 +03:00
|
|
|
description: "Branch or ref to pull down."
|
2020-09-02 19:57:28 +03:00
|
|
|
required: false
|
2021-02-21 19:48:08 +03:00
|
|
|
default: "dev"
|
2020-09-02 19:57:28 +03:00
|
|
|
dir:
|
2021-02-21 19:48:08 +03:00
|
|
|
description: "Directory we expect to run in."
|
2020-09-02 19:57:28 +03:00
|
|
|
required: false
|
2021-02-21 19:48:08 +03:00
|
|
|
default: "tauri/examples/helloworld"
|
2020-09-02 19:57:28 +03:00
|
|
|
buildAssets:
|
2021-02-21 19:48:08 +03:00
|
|
|
description: "Command to build the assets."
|
2020-09-02 19:57:28 +03:00
|
|
|
required: false
|
2021-02-21 19:48:08 +03:00
|
|
|
default: "echo no build needed"
|
2020-09-02 19:57:28 +03:00
|
|
|
buildTauri:
|
2021-02-21 19:48:08 +03:00
|
|
|
description: "Command to build the Tauri app."
|
2020-09-02 19:57:28 +03:00
|
|
|
required: false
|
2021-02-21 19:48:08 +03:00
|
|
|
default: "tauri"
|
2020-06-17 22:30:41 +03:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
2019-12-02 17:20:20 +03:00
|
|
|
|
|
|
|
jobs:
|
2020-09-02 19:57:28 +03:00
|
|
|
create-and-upload-assets:
|
2019-12-02 17:20:20 +03:00
|
|
|
runs-on: ${{ matrix.platform }}
|
2020-09-02 19:57:28 +03:00
|
|
|
timeout-minutes: 30
|
2019-12-02 17:20:20 +03:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
2019-12-03 01:48:43 +03:00
|
|
|
include:
|
2019-12-04 22:24:27 +03:00
|
|
|
- platform: ubuntu-latest
|
|
|
|
releaseFolder: target/release/bundle/deb
|
|
|
|
- platform: macos-latest
|
2021-03-25 07:56:00 +03:00
|
|
|
releaseFolder: target/release/bundle/macos
|
2019-12-03 01:48:43 +03:00
|
|
|
- platform: windows-latest
|
2020-09-02 19:57:28 +03:00
|
|
|
releaseFolder: target/release/bundle/msi
|
2019-12-02 17:20:20 +03:00
|
|
|
|
|
|
|
steps:
|
2020-09-02 19:57:28 +03:00
|
|
|
- uses: actions/checkout@v2
|
2020-02-17 00:28:37 +03:00
|
|
|
with:
|
2020-09-02 19:57:28 +03:00
|
|
|
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:
|
2020-11-10 17:46:23 +03:00
|
|
|
node-version: 14
|
2020-01-14 16:55:39 +03:00
|
|
|
- name: install rust stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-12-02 17:20:20 +03:00
|
|
|
toolchain: stable
|
2019-12-30 03:41:03 +03:00
|
|
|
profile: minimal
|
2020-01-14 16:55:39 +03:00
|
|
|
- name: install webkit2gtk (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y webkit2gtk-4.0
|
2020-09-02 19:57:28 +03:00
|
|
|
- name: yarn install for cli
|
2021-04-12 07:59:25 +03:00
|
|
|
working-directory: tauri/tooling/cli.js
|
2020-02-17 00:28:37 +03:00
|
|
|
run: yarn
|
2021-04-12 07:59:25 +03:00
|
|
|
- name: build cli.js
|
|
|
|
working-directory: tauri/tooling/cli.js
|
2020-09-02 19:57:28 +03:00
|
|
|
run: |
|
|
|
|
yarn build-release
|
|
|
|
yarn global add $PWD
|
|
|
|
echo "::add-path::$(yarn global bin)"
|
|
|
|
- name: install and build assets
|
2021-02-21 19:48:08 +03:00
|
|
|
working-directory: "example/${{ github.event.inputs.dir }}"
|
2020-09-02 19:57:28 +03:00
|
|
|
run: ${{ github.event.inputs.buildAssets }}
|
|
|
|
- name: build tauri app
|
|
|
|
uses: tauri-apps/tauri-action@v0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-01-14 16:55:39 +03:00
|
|
|
with:
|
2020-09-02 19:57:28 +03:00
|
|
|
includeDebug: true
|
2021-02-21 19:48:08 +03:00
|
|
|
projectPath: "example/${{ github.event.inputs.dir }}"
|
2020-09-02 19:57:28 +03:00
|
|
|
preferGlobal: true
|
|
|
|
- uses: actions/upload-artifact@v2
|
2020-01-14 16:55:39 +03:00
|
|
|
if: success()
|
|
|
|
with:
|
2020-09-02 19:57:28 +03:00
|
|
|
name: tauri-app.${{ matrix.platform }}
|
|
|
|
path: ${{ format('./{0}{1}/src-tauri/{2}/**', 'example/', github.event.inputs.dir, matrix.releaseFolder ) }}
|