-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (109 loc) · 4.24 KB
/
Copy pathrelease.yaml
File metadata and controls
127 lines (109 loc) · 4.24 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
name: Release
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 22
# tauri-build statically links the versioned VC runtime when this is enabled.
STATIC_VCRUNTIME: "true"
jobs:
build-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest
args: "--target aarch64-apple-darwin"
rust-targets: "aarch64-apple-darwin,x86_64-apple-darwin"
binary-arch: arm64
- platform: macos-latest
args: "--target x86_64-apple-darwin"
rust-targets: "aarch64-apple-darwin,x86_64-apple-darwin"
binary-arch: x86_64
- platform: ubuntu-22.04
args: ""
rust-targets: ""
- platform: windows-latest
args: ""
rust-targets: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install system dependencies (Linux only)
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
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install Rust toolchain
run: rustup toolchain install --no-self-update
- name: Install Rust targets
if: matrix['rust-targets'] != ''
run: rustup target add $(echo "${{ matrix['rust-targets'] }}" | tr ',' ' ')
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- run: pnpm install
- name: Remove cached package artifacts
shell: bash
run: |
if [ -d target ]; then
find target -type d -name bundle -prune -exec rm -rf {} +
fi
- uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: "procnote v__VERSION__"
releaseBody: "See the assets to download and install this version."
releaseDraft: true
prerelease: false
tauriScript: "pnpm run tauri"
args: ${{ matrix.args }}
- name: Validate packaged macOS launcher
if: runner.os == 'macOS'
shell: bash
run: |
dmg=$(find target -type f -path '*/bundle/dmg/*.dmg' -print -quit)
test -n "$dmg"
scripts/validate-macos-package.sh "$dmg" "${{ matrix['binary-arch'] }}"
- name: Validate packaged Linux launcher
if: runner.os == 'Linux'
shell: bash
run: |
deb=$(find target -type f -path '*/bundle/deb/*.deb' -print -quit)
test -n "$deb"
scripts/validate-linux-package.sh "$deb"
- name: Validate packaged Windows launchers and installers
if: runner.os == 'Windows'
shell: pwsh
run: |
$installer = Get-ChildItem target -Recurse -Filter "*-setup.exe" |
Where-Object { $_.FullName.Contains("\bundle\nsis\") } |
Select-Object -First 1
$msi = Get-ChildItem target -Recurse -Filter "*.msi" |
Where-Object { $_.FullName.Contains("\bundle\msi\") } |
Select-Object -First 1
if ($null -eq $installer) {
throw "NSIS installer was not produced"
}
if ($null -eq $msi) {
throw "MSI installer was not produced"
}
$legacyInstaller = Join-Path $env:RUNNER_TEMP "procnote_0.0.4_x64-setup.exe"
Invoke-WebRequest `
-Uri "https://github.com/ut-issl/procnote/releases/download/v0.0.4/procnote_0.0.4_x64-setup.exe" `
-OutFile $legacyInstaller
./scripts/validate-windows-package.ps1 `
-InstallerPath $installer.FullName `
-MsiPath $msi.FullName `
-LegacyInstallerPath $legacyInstaller