5
5
- release
6
6
7
7
jobs :
8
- rust :
9
- name : Rust
8
+ build-server :
9
+ name : build-server
10
10
runs-on : ${{ matrix.os }}
11
11
strategy :
12
12
matrix :
@@ -35,13 +35,12 @@ jobs:
35
35
toolchain : stable
36
36
profile : minimal
37
37
override : true
38
- components : rustfmt, rust-src
39
38
40
39
- name : Build
41
40
uses : actions-rs/cargo@v1
42
41
with :
43
42
command : build
44
- args : --release -- package ra_lsp_server --bin ra_lsp_server
43
+ args : --package ra_lsp_server --bin ra_lsp_server --release
45
44
46
45
- name : Strip symbols
47
46
if : matrix.os == 'ubuntu-latest'
@@ -50,22 +49,26 @@ jobs:
50
49
- name : Create distribution dir
51
50
run : mkdir ./dist
52
51
53
- - name : Copy binaries (unix)
54
- if : matrix.os != 'windows-latest'
55
- run : cp ./target/release/ra_lsp_server ./dist
52
+ - name : Copy binary
53
+ if : matrix.os == 'ubuntu-latest'
54
+ run : cp ./target/release/ra_lsp_server ./dist/ra_lsp_server-linux
55
+
56
+ - name : Copy binary
57
+ if : matrix.os == 'macos-latest'
58
+ run : cp ./target/release/ra_lsp_server ./dist/ra_lsp_server-mac
56
59
57
- - name : Copy binaries (win)
60
+ - name : Copy binary
58
61
if : matrix.os == 'windows-latest'
59
- run : copy ./target/release/ra_lsp_server.exe ./dist
62
+ run : copy ./target/release/ra_lsp_server.exe ./dist/ra_lsp_server-windows.exe
60
63
61
64
- name : Upload artifacts
62
65
uses : actions/upload-artifact@v1
63
66
with :
64
67
name : server-${{ matrix.os }}
65
68
path : ./dist
66
69
67
- type-script :
68
- name : TypeScript
70
+ build-clients :
71
+ name : build-clients
69
72
runs-on : ubuntu-latest
70
73
steps :
71
74
- name : Checkout repository
@@ -83,13 +86,95 @@ jobs:
83
86
working-directory : ./editors/code
84
87
85
88
- name : Copy vscode extension
86
- run : mkdir -p ./dist/code && cp ./editors/code/*.vsix ./dist/code/
89
+ run : mkdir -p ./dist/code && cp ./editors/code/*.vsix ./dist/
87
90
88
91
- name : Copy emacs mode
89
- run : cp -R ./editors/emacs ./dist/
92
+ run : cp ./editors/emacs/rust-analyzer.el ./dist/rust-analyzer.el
90
93
91
94
- name : Upload artifacts
92
95
uses : actions/upload-artifact@v1
93
96
with :
94
97
name : editor-plugins
95
98
path : ./dist
99
+
100
+ make-release :
101
+ name : make-release
102
+ runs-on : ubuntu-latest
103
+ needs : ['build-server', 'build-clients']
104
+ steps :
105
+ - uses : actions/download-artifact@v1
106
+ with :
107
+ name : editor-plugins
108
+ path : dist
109
+ - uses : actions/download-artifact@v1
110
+ with :
111
+ name : server-macos-latest
112
+ path : dist
113
+ - uses : actions/download-artifact@v1
114
+ with :
115
+ name : server-ubuntu-latest
116
+ path : dist
117
+ - uses : actions/download-artifact@v1
118
+ with :
119
+ name : server-windows-latest
120
+ path : dist
121
+ - run : ls -all ./dist
122
+
123
+ - run : echo "::set-env name=TAG::$(date --iso)"
124
+ - run : ' echo "TAG: $TAG"'
125
+
126
+ - name : Create Release
127
+ id : create_release
128
+ uses : actions/create-release@v1
129
+ env :
130
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131
+ with :
132
+ tag_name : ${{ env.TAG }}
133
+ release_name : ${{ env.TAG }}
134
+ draft : false
135
+ prerelease : false
136
+
137
+
138
+ env :
139
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
140
+ with :
141
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
142
+ asset_path : ./dist/ra_lsp_server-linux
143
+ asset_name : ra_lsp_server-linux
144
+ asset_content_type : application/octet-stream
145
+
146
+
147
+ env :
148
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
149
+ with :
150
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
151
+ asset_path : ./dist/ra_lsp_server-mac
152
+ asset_name : ra_lsp_server-mac
153
+ asset_content_type : application/octet-stream
154
+
155
+
156
+ env :
157
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
158
+ with :
159
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
160
+ asset_path : ./dist/ra_lsp_server-windows.exe
161
+ asset_name : ra_lsp_server-windows.exe
162
+ asset_content_type : application/octet-stream
163
+
164
+
165
+ env :
166
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
167
+ with :
168
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
169
+ asset_path : ./dist/rust-analyzer-0.1.0.vsix
170
+ asset_name : rust-analyzer-0.1.0.vsix
171
+ asset_content_type : application/octet-stream
172
+
173
+
174
+ env :
175
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
176
+ with :
177
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
178
+ asset_path : ./dist/rust-analyzer.el
179
+ asset_name : rust-analyzer.el
180
+ asset_content_type : text/plain
0 commit comments