55 - release
66
77jobs :
8- rust :
9- name : Rust
8+ build-server :
9+ name : build-server
1010 runs-on : ${{ matrix.os }}
1111 strategy :
1212 matrix :
@@ -35,13 +35,12 @@ jobs:
3535 toolchain : stable
3636 profile : minimal
3737 override : true
38- components : rustfmt, rust-src
3938
4039 - name : Build
4140 uses : actions-rs/cargo@v1
4241 with :
4342 command : build
44- args : --release -- package ra_lsp_server --bin ra_lsp_server
43+ args : --package ra_lsp_server --bin ra_lsp_server --release
4544
4645 - name : Strip symbols
4746 if : matrix.os == 'ubuntu-latest'
@@ -50,22 +49,26 @@ jobs:
5049 - name : Create distribution dir
5150 run : mkdir ./dist
5251
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
5659
57- - name : Copy binaries (win)
60+ - name : Copy binary
5861 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
6063
6164 - name : Upload artifacts
6265 uses : actions/upload-artifact@v1
6366 with :
6467 name : server-${{ matrix.os }}
6568 path : ./dist
6669
67- type-script :
68- name : TypeScript
70+ build-clients :
71+ name : build-clients
6972 runs-on : ubuntu-latest
7073 steps :
7174 - name : Checkout repository
@@ -83,13 +86,95 @@ jobs:
8386 working-directory : ./editors/code
8487
8588 - 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/
8790
8891 - name : Copy emacs mode
89- run : cp -R ./editors/emacs ./dist/
92+ run : cp ./editors/emacs/rust-analyzer.el ./dist/rust-analyzer.el
9093
9194 - name : Upload artifacts
9295 uses : actions/upload-artifact@v1
9396 with :
9497 name : editor-plugins
9598 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