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