-
Notifications
You must be signed in to change notification settings - Fork 63
163 lines (143 loc) · 4.86 KB
/
release.yml
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
name: Release
on:
push:
tags: ["*"]
workflow_dispatch:
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
build-plugin:
needs: ["create-release"]
name: Build Roblox Studio Plugin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ok-nick/[email protected]
- name: Build Plugin
run: rojo build plugin --output Luau.rbxm
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Luau.rbxm
path: Luau.rbxm
- name: Upload Plugin to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: Luau.rbxm
asset_name: Luau.rbxm
asset_content_type: application/octet-stream
- name: Publish Plugin to Roblox
env:
ROBLOX_API_KEY: ${{ secrets.ROBLOX_API_KEY }}
working-directory: plugin
run: |
rojo build test.project.json --output plugin_place.rbxl
lune run cloud/execute_task.luau plugin_place.rbxl cloud/publishing_task.luau
dist:
needs: ["create-release"]
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact-name: luau-lsp-win64
code-target: [win32-x64, win32-arm64]
- os: ubuntu-20.04
artifact-name: luau-lsp-linux
code-target: [linux-x64]
- os: ubuntu-20.04
artifact-name: luau-lsp-linux-arm64
code-target: [linux-arm64]
- os: macos-latest
artifact-name: luau-lsp-macos
code-target: [darwin-x64, darwin-arm64]
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build Server
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DLSP_STATIC_CRT:BOOL=ON
cmake --build . --config Release --target Luau.LanguageServer.CLI -j 3
- name: (MacOS) Verify universal build
if: matrix.os == 'macos-latest'
run: lipo -archs 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/Release/luau-lsp.exe editors/code/bin/server.exe
else
cp build/luau-lsp editors/code/bin/server
chmod 777 editors/code/bin/server
fi
- name: Create Release Archive
shell: bash
run: |
mkdir staging
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "build/Release/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
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.artifact-name }}
path: ./dist
- name: Upload Server to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./dist/server.zip
asset_name: ${{ matrix.artifact-name }}.zip
asset_content_type: application/octet-stream
- run: npm ci
working-directory: editors/code
- name: Publish Extension
working-directory: editors/code
run: npx @vscode/vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --target ${{ join(matrix.code-target, ' ') }}
- name: Publish OpenVSX Extension
working-directory: editors/code
run: npx ovsx publish --pat ${{ secrets.OVSX_TOKEN }} --target ${{ join(matrix.code-target, ' ') }}