Skip to content

Release smoke app

Release smoke app #13

name: Release smoke app
on:
workflow_dispatch:
inputs:
release_tag:
description: Package release tag, for example create-tauri-ui@1.0.1
required: true
type: string
release_id:
description: GitHub release numeric id
required: true
type: string
release:
types:
- created
- published
- released
concurrency: ${{ github.workflow }}-${{ github.run_id }}
jobs:
publish-smoke-app:
name: Upload generated Vite app
if: |
(github.event_name == 'release' && startsWith(github.event.release.tag_name, 'create-tauri-ui@')) ||
(github.event_name == 'workflow_dispatch' && startsWith(inputs.release_tag, 'create-tauri-ui@'))
permissions:
contents: write
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- name: Windows
platform: windows-latest
args: ""
- name: macOS Apple Silicon
platform: macos-latest
args: "--target aarch64-apple-darwin"
- name: macOS Intel
platform: macos-latest
args: "--target x86_64-apple-darwin"
- name: Linux
platform: ubuntu-22.04
args: ""
runs-on: ${{ matrix.platform }}
env:
APP_DIR: release-smoke-app
steps:
- name: Resolve release metadata
id: release
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "tag=${{ inputs.release_tag }}" >> "$GITHUB_OUTPUT"
echo "id=${{ inputs.release_id }}" >> "$GITHUB_OUTPUT"
echo "url=https://github.com/${{ github.repository }}/releases/tag/${{ inputs.release_tag }}" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
echo "id=${{ github.event.release.id }}" >> "$GITHUB_OUTPUT"
echo "url=${{ github.event.release.html_url }}" >> "$GITHUB_OUTPUT"
- name: Checkout release tag
uses: actions/checkout@v4
with:
ref: ${{ steps.release.outputs.tag }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Linux system dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Install workspace dependencies
run: bun install --frozen-lockfile
- name: Build create-tauri-ui
run: bun run --cwd packages/create-tauri-ui build
- name: Generate release smoke app
run: |
rm -rf "$APP_DIR"
node packages/create-tauri-ui/index.js "$APP_DIR" \
--template vite \
--identifier com.agm.create-tauri-ui-release-smoke \
--yes \
--no-workflow
- name: Install smoke app dependencies
working-directory: ${{ env.APP_DIR }}
run: bun install
- name: Build and upload smoke app
id: tauri
uses: tauri-apps/tauri-action@action-v0.6.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ steps.release.outputs.id }}
projectPath: ${{ env.APP_DIR }}
args: ${{ matrix.args }}
retryAttempts: 2
assetNamePattern: "[name]-smoke-[version]-[platform]-[arch][ext]"
includeUpdaterJson: false
- name: Smoke app summary
if: steps.tauri.outputs.releaseHtmlUrl != ''
run: |
{
echo "## Generated Vite smoke app"
echo ""
echo "- Package release: ${{ steps.release.outputs.url }}"
echo "- Platform: \`${{ matrix.name }}\`"
echo "- App version: \`${{ steps.tauri.outputs.appVersion }}\`"
echo "- Artifacts: \`${{ steps.tauri.outputs.artifactPaths }}\`"
} >> "$GITHUB_STEP_SUMMARY"