-
Notifications
You must be signed in to change notification settings - Fork 125
145 lines (128 loc) 路 4.82 KB
/
Copy pathrelease-smoke-app.yml
File metadata and controls
145 lines (128 loc) 路 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
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: ""
asset_suffix: windows-x64
- name: macOS Apple Silicon
platform: macos-latest
args: "--target aarch64-apple-darwin"
asset_suffix: macos-apple-silicon
- name: macOS Intel
platform: macos-latest
args: "--target x86_64-apple-darwin"
asset_suffix: macos-intel
- name: Linux
platform: ubuntu-22.04
args: ""
asset_suffix: linux-x64
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
VERSION="$(printf '%s' '${{ inputs.release_tag }}' | sed 's/^.*@//')"
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"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
exit 0
fi
VERSION="$(printf '%s' '${{ github.event.release.tag_name }}' | sed 's/^.*@//')"
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"
echo "version=$VERSION" >> "$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 }}
appName: tauri-ui-smoke
appVersion: ${{ steps.release.outputs.version }}
args: ${{ matrix.args }}
retryAttempts: 2
assetNamePattern: "tauri-ui-smoke-v${{ steps.release.outputs.version }}-${{ matrix.asset_suffix }}[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"