-
Notifications
You must be signed in to change notification settings - Fork 1
145 lines (124 loc) · 4.7 KB
/
Copy pathrelease.yml
File metadata and controls
145 lines (124 loc) · 4.7 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
# Triggered by pushing a version tag (e.g. v0.2.0).
# The release.sh script creates these tags.
#
# This workflow builds signed installers for all platforms and creates a
# GitHub Release with the artifacts attached.
on:
push:
tags:
- 'v*'
env:
NODE_VERSION: 20
jobs:
# ── 1. Build the extension host (platform-agnostic TypeScript) ──
build-extension-host:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: extension-host/package-lock.json
- name: Build extension host
run: |
cd extension-host
npm ci
npm run build
- name: Upload extension-host dist
uses: actions/upload-artifact@v4
with:
name: extension-host-dist
path: extension-host/dist/**
if-no-files-found: error
# ── 2. Build Tauri app for each platform ──
release:
needs: [build-extension-host]
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
target: 'aarch64-apple-darwin'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
# jemalloc (tikv-jemalloc-sys) does not build on Windows
args: '-- --no-default-features'
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
# Work around dtolnay/rust-toolchain@stable bug on Windows where
# an internal grep step exits with code 1 due to bash -e.
# Rust is pre-installed on GitHub Actions runners, so this is safe.
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
continue-on-error: ${{ matrix.platform == 'windows-latest' }}
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Verify Rust installation
if: matrix.platform == 'windows-latest'
run: |
rustc --version
cargo --version
shell: bash
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Install Tauri dependencies (Ubuntu)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
# Intel macOS cross-compilation requires x86_64 Homebrew OpenSSL
- name: Install x86_64 OpenSSL (macOS Intel cross-build)
if: matrix.target == 'x86_64-apple-darwin'
run: |
arch -x86_64 /usr/local/bin/brew install openssl@3 || true
echo "OPENSSL_DIR=$(arch -x86_64 /usr/local/bin/brew --prefix openssl@3 2>/dev/null || echo /usr/local/opt/openssl@3)" >> "$GITHUB_ENV"
shell: bash
- name: Install frontend dependencies
run: npm ci
- name: Download extension-host dist
uses: actions/download-artifact@v4
with:
name: extension-host-dist
path: extension-host/dist
- name: Download Node.js for external binary
run: bash ./scripts/download-node.sh --all
# Ad-hoc codesigning on macOS prevents "damaged" Gatekeeper errors
# on Apple Silicon. Will be replaced with proper Developer ID signing
# once an Apple Developer account is available.
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODESIGN_IDENTITY: ${{ matrix.platform == 'macos-latest' && '-' || '' }}
with:
tagName: ${{ github.ref_name }}
releaseName: 'DSCode ${{ github.ref_name }}'
releaseBody: |
## What's New
See the [CHANGELOG](../blob/main/CHANGELOG.md) for full details.
## Assets
Download the installer for your platform below:
- **macOS (Apple Silicon)**: `.dmg`
- **macOS (Intel)**: `.dmg`
- **Linux (x86_64)**: `.deb` or `.AppImage`
- **Windows (x86_64)**: `.msi` or `.exe`
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}