# Copyright 2019-2021 Tauri Programme within The Commons Conservancy # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT 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/macos - 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 ) }}