-
Notifications
You must be signed in to change notification settings - Fork 155
143 lines (124 loc) · 4.56 KB
/
Copy pathnightly.yml
File metadata and controls
143 lines (124 loc) · 4.56 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
name: Nightly Release
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Runs at 00:00 UTC every day
env:
MACOSX_DEPLOYMENT_TARGET: "10.15"
jobs:
dist:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact-name: luau-lsp-win64
code-target: [win32-x64]
crash-reporting: true
- os: ubuntu-22.04
artifact-name: luau-lsp-linux
code-target: [linux-x64]
crash-reporting: false
- os: macos-latest
artifact-name: luau-lsp-macos
code-target: [darwin-x64, darwin-arm64]
crash-reporting: true
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set Nightly Version
shell: bash
run: |
DATE=$(date +%Y%m%d)
VERSION="0.$DATE.0"
sed -i.bak "s/set(LSP_VERSION .*/set(LSP_VERSION \"$VERSION\")/g" CMakeLists.txt
jq ".version = \"$VERSION\"" editors/code/package.json > tmp.json && mv tmp.json editors/code/package.json
- name: Build Server
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DLSP_STATIC_CRT:BOOL=ON -DLUAU_ENABLE_TIME_TRACE:BOOL=ON -DLSP_BUILD_WITH_SENTRY:BOOL=${{ matrix.crash-reporting }} ..
cmake --build . --config RelWithDebInfo --target Luau.LanguageServer.CLI -j 3
- name: (MacOS) Verify universal build
if: matrix.os == 'macos-latest'
run: lipo -archs build/luau-lsp
- name: (MacOS) Separate debug symbols
if: matrix.os == 'macos-latest'
run: dsymutil build/luau-lsp && strip -S build/luau-lsp
- name: (Linux) Separate debug symbols
if: matrix.os == 'ubuntu-22.04'
run: objcopy --only-keep-debug build/luau-lsp build/luau-lsp.dbg && objcopy --strip-debug build/luau-lsp
- name: Copy Build into Extension
shell: bash
run: |
mkdir -p ./dist
mkdir -p editors/code/bin
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp build/RelWithDebInfo/luau-lsp.exe editors/code/bin/server.exe
cp build/RelWithDebInfo/luau-lsp.pdb editors/code/bin/server.pdb
else
cp build/luau-lsp editors/code/bin/server
chmod 777 editors/code/bin/server
fi
- name: Copy Crashpad Handler into Extension
shell: bash
if: matrix.crash-reporting == true
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp build/RelWithDebInfo/crashpad_handler.exe editors/code/bin/crashpad_handler.exe
else
cp build/crashpad_handler editors/code/bin/crashpad_handler
chmod 777 editors/code/bin/crashpad_handler
fi
- name: Setup Sentry CLI
uses: matbour/setup-sentry-cli@v2
if: matrix.crash-reporting == true
with:
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
organization: luau-lsp
project: luau-lsp
- name: Upload debug symbols
shell: bash
if: matrix.crash-reporting == true
run: |
rm -rf build/_deps
sentry-cli debug-files upload --include-sources build
- name: Create Release Archive
shell: bash
run: |
mkdir staging
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "build/RelWithDebInfo/luau-lsp.exe" staging/
cd staging
7z a ../dist/server.zip *
else
cp "build/luau-lsp" staging/
cd staging
zip ../dist/server.zip *
fi
- name: Copy README, CHANGELOG, LICENSE
shell: bash
run: |
rm -f editors/code/README.md
cp README.md editors/code/README.md
rm -f editors/code/CHANGELOG.md
cp CHANGELOG.md editors/code/CHANGELOG.md
rm -f editors/code/LICENSE.md
cp LICENSE.md editors/code/LICENSE
- run: npm ci
working-directory: editors/code
- name: Package Extension
working-directory: editors/code
run: npx vsce package -o "../../dist/${{ matrix.artifact-name }}.vsix"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nightly-${{ matrix.artifact-name }}
path: ./dist