Repository navigation
108 lines (96 loc) · 3.25 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (96 loc) · 3.25 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: '--target aarch64-apple-darwin'
- platform: macos-latest
args: '--target x86_64-apple-darwin'
- platform: ubuntu-22.04
args: ''
- platform: windows-latest
args: ''
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release notes
id: release_notes
shell: bash
run: |
CURRENT_TAG="${GITHUB_REF_NAME}"
PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+' | grep -Fxv "$CURRENT_TAG" | head -n 1 || true)
if [ -n "$PREV_TAG" ]; then
CHANGES=$(git log "${PREV_TAG}..HEAD" --no-merges --pretty=format:"- %s")
else
CHANGES=$(git log -n 15 --no-merges --pretty=format:"- %s")
fi
{
echo "body<<EOF"
echo "## What's Changed"
echo ""
if [ -n "$CHANGES" ]; then
echo "$CHANGES"
else
echo "- Maintenance release"
fi
echo ""
if [ -n "$PREV_TAG" ]; then
echo "**Full Changelog**: https://github.com/${GITHUB_REPOSITORY}/compare/${PREV_TAG}...${CURRENT_TAG}"
echo ""
fi
echo "See the assets below to download Web2AI API Desktop for your platform."
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Rust stable
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
with:
workspaces: desktop/src-tauri
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev
- name: Install frontend dependencies
run: bun install --cwd desktop
- name: Build and release Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY || '-' }}
with:
projectPath: desktop
tagName: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || 'v__VERSION__' }}
releaseName: 'Web2AI v__VERSION__'
releaseBody: ${{ steps.release_notes.outputs.body }}
releaseDraft: false
prerelease: false
includeUpdaterJson: true
args: ${{ matrix.args }}