Repository navigation
178 lines (154 loc) · 5.47 KB
/
Copy pathrelease.yml
File metadata and controls
178 lines (154 loc) · 5.47 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
LOCALTEX_MODELS_TAG: v0.0.0
jobs:
version:
name: Resolve version
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
contents: read
actions: read
outputs:
version: ${{ steps.resolve.outputs.version }}
tag: ${{ steps.resolve.outputs.tag }}
steps:
- uses: actions/checkout@v7
- name: Require successful Check CI for this commit
env:
GH_TOKEN: ${{ github.token }}
run: |
conclusion=$(gh run list --workflow check.yml --commit "$GITHUB_SHA" \
--limit 100 --json event,conclusion \
--jq 'map(select(.event == "push" or .event == "workflow_dispatch")) | first | .conclusion // ""')
if [ "$conclusion" != success ]; then
echo "::error::Check CI must pass for $GITHUB_SHA before releasing. Wait for Check on main, or run it manually for this commit, then rerun Release."
exit 1
fi
- id: resolve
name: Match tag to Cargo.toml
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
if [ -z "$version" ]; then
echo "::error::No version in Cargo.toml"
exit 1
fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "tag=v$version" >> "$GITHUB_OUTPUT"
if [ "$GITHUB_EVENT_NAME" = push ]; then
if [ "${GITHUB_REF_NAME}" != "v${version}" ]; then
echo "::error::Tag ${GITHUB_REF_NAME} does not match Cargo.toml version ${version}"
exit 1
fi
fi
linux-x86_64:
name: Linux x86_64
needs: version
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Install packaging dependencies
run: |
sudo apt-get update
sudo apt-get install --yes \
clang libclang-dev cmake pkg-config dpkg-dev \
libfontconfig-dev libgbm-dev libegl1-mesa-dev \
libpipewire-0.3-dev libvulkan-dev libx11-dev libx11-xcb-dev \
libxcb1-dev libxkbcommon-x11-dev
- uses: Swatinem/rust-cache@v2
with:
key: release-linux-x86_64
- name: Bundle
env:
GH_TOKEN: ${{ github.token }}
run: ./scripts/bundle-linux.sh
- uses: actions/upload-artifact@v7
with:
name: linux-x86_64
path: |
dist/localtex-${{ needs.version.outputs.version }}-x86_64-unknown-linux-gnu.tar.gz
dist/localtex_${{ needs.version.outputs.version }}_amd64.deb
if-no-files-found: error
windows-x86_64:
name: Windows x86_64
needs: version
runs-on: windows-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- name: Locate the Windows shader compiler
shell: pwsh
run: |
$fxc = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\fxc.exe" |
Sort-Object FullName -Descending |
Select-Object -First 1
if (-not $fxc) { throw 'fxc.exe was not found in the Windows SDK' }
"GPUI_FXC_PATH=$($fxc.FullName)" | Add-Content $env:GITHUB_ENV
- name: Install Inno Setup 7
shell: pwsh
run: |
$ProgressPreference = "SilentlyContinue"
$setup = Join-Path $env:RUNNER_TEMP "innosetup-7.1.0-x64.exe"
Invoke-WebRequest -Uri "https://github.com/jrsoftware/issrc/releases/download/is-7_1_0/innosetup-7.1.0-x64.exe" -OutFile $setup -UseBasicParsing
Start-Process -FilePath $setup -ArgumentList "/VERYSILENT","/SUPPRESSMSGBOXES","/NORESTART","/SP-" -Wait
$iscc = @(
"${env:ProgramFiles}\Inno Setup 7\ISCC.exe",
"${env:ProgramFiles(x86)}\Inno Setup 7\ISCC.exe"
) | Where-Object { Test-Path $_ } | Select-Object -First 1
if (-not $iscc) { throw "Inno Setup 7 ISCC.exe not found after install" }
- uses: Swatinem/rust-cache@v2
with:
key: release-windows-x86_64
- name: Bundle
env:
GH_TOKEN: ${{ github.token }}
shell: pwsh
run: .\scripts\bundle-windows.ps1
- uses: actions/upload-artifact@v7
with:
name: windows-x86_64
path: |
dist/localtex-${{ needs.version.outputs.version }}-x86_64-pc-windows-msvc.zip
dist/LocalTeX-${{ needs.version.outputs.version }}-x86_64-Setup.exe
if-no-files-found: error
publish:
name: Publish GitHub release
needs: [version, linux-x86_64, windows-x86_64]
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- name: Checksums
run: |
cd artifacts
sha256sum -- * > SHA256SUMS
cat SHA256SUMS
- uses: softprops/action-gh-release@v3
with:
tag_name: ${{ needs.version.outputs.tag }}
target_commitish: ${{ github.sha }}
name: ${{ needs.version.outputs.tag }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
artifacts/*