-
-
Notifications
You must be signed in to change notification settings - Fork 23
178 lines (161 loc) · 5.96 KB
/
release-amxxpawn.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: release (AMXXPawn)
on:
push:
branches:
- main
jobs:
build:
name: Build ${{ matrix.target }}
if: "contains(github.event.head_commit.message, 'trigger-ci: amxxpawn')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
program: cargo
platform: win32
arch: x64
archive: sourcepawn_lsp-x86_64-windows.zip
- os: windows-latest
target: i686-pc-windows-msvc
program: cargo
platform: win32
arch: ia32
archive: sourcepawn_lsp-i686-windows.zip
- os: windows-latest
target: aarch64-pc-windows-msvc
program: cargo
platform: win32
arch: arm64
archive: sourcepawn_lsp-aarch64-windows.zip
- os: macos-latest
target: x86_64-apple-darwin
program: cargo
platform: darwin
arch: x64
archive: sourcepawn_lsp-x86_64-macos.zip
- os: macos-latest
target: aarch64-apple-darwin
program: cargo
platform: darwin
arch: arm64
archive: sourcepawn_lsp-aarch64-macos.zip
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
program: cargo
platform: linux
arch: x64
archive: sourcepawn_lsp-x86_64-linux.zip
- os: ubuntu-20.04
target: aarch64-unknown-linux-gnu
program: cross
platform: linux
arch: arm64
archive: sourcepawn_lsp-aarch64-linux.zip
- os: ubuntu-20.04
target: armv7-unknown-linux-gnueabihf
program: cross
platform: linux
arch: armhf
archive: sourcepawn_lsp-armv7hf-linux.zip
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 16.x
- name: Setup Sentry CLI
uses: mathieu-bour/setup-sentry-cli@v1
with:
token: ${{ SECRETS.SENTRY_AUTH_TOKEN }}
organization: ${{ secrets.SENTRY_ORG }}
project: sourcepawn-lsp
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: ${{ matrix.program == 'cross' }}
run: cargo install cross
- name: Install libssl-dev
if: ${{ contains(matrix.os, 'ubuntu') }}
run: sudo apt-get install pkg-config libssl-dev
- name: Compile
run: ${{ matrix.program }} build --target ${{ matrix.target }} --all-features --release --locked
- name: Compress (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: ${{ format('Compress-Archive target/{0}/release/sourcepawn_lsp.exe {1}', matrix.target, matrix.archive) }}
- name: Compress (macOS)
if: ${{ contains(matrix.os, 'macos') }}
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn_lsp', matrix.target, matrix.archive) }}
- name: Compress (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: ${{ format('zip -j {1} target/{0}/release/sourcepawn_lsp', matrix.target, matrix.archive) }}
- name: Upload debug symbols
run: sentry-cli upload-dif --wait target/${{ matrix.target }}/release/
- shell: pwsh
run: echo "target=${{ matrix.platform }}-${{ matrix.arch }}" >> $env:GITHUB_ENV
- name: Install npm dependencies
working-directory: ./editors/code-amxxpawn
run: npm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bundle sourcepawn-lsp (Windows)
if: ${{ contains(matrix.os, 'windows') }}
shell: pwsh
run: |
mkdir -p editors/code-amxxpawn/languageServer
cp target/${{ matrix.target }}/release/sourcepawn_lsp.exe editors/code-amxxpawn/languageServer/
- name: Bundle sourcepawn-lsp
if: ${{ !contains(matrix.os, 'windows') }}
shell: pwsh
run: |
mkdir -p editors/code-amxxpawn/languageServer
cp target/${{ matrix.target }}/release/sourcepawn_lsp editors/code-amxxpawn/languageServer/
- name: Package VSCode extension
working-directory: ./editors/code-amxxpawn
run: npx vsce package --target ${{ env.target }}
- name: Upload sourcepawn-lsp binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: ${{ matrix.archive }}
- name: Upload VSIX package
uses: actions/upload-artifact@v3
with:
name: ${{ env.target }}
path: "editors/code-amxxpawn/*.vsix"
marketplace:
name: Publish to VSCode marketplace
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Publish VSIX package (Release)
if: ${{ !github.event.prerelease }}
run: npx vsce publish --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
- name: Publish VSIX package (Prerelease)
if: ${{ github.event.prerelease }}
run: npx vsce publish --packagePath $(find . -iname *.vsix) --pre-release
env:
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
ovsx:
name: Publish to Open VSX
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Publish VSIX package (Release)
if: ${{ !github.event.prerelease }}
run: npx ovsx publish -p $OVSX_TOKEN --packagePath $(find . -iname *.vsix)
env:
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }}
- name: Publish VSIX package (Prerelease)
if: ${{ github.event.prerelease }}
run: npx ovsx publish -p $OVSX_TOKEN --packagePath $(find . -iname *.vsix) --pre-release
env:
OVSX_TOKEN: ${{ secrets.OVSX_TOKEN }}