diff options
author | Aleksey Kladov <[email protected]> | 2020-01-13 13:48:13 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-13 13:48:13 +0000 |
commit | 79c7394da2af35fa5fd2a31acdce1e31489652b7 (patch) | |
tree | 04a8388303c1855795b4af1d0d48105845ceb4a1 | |
parent | 875352b2b64220e4e76d1aa49d51e85a46344d6a (diff) | |
parent | 5514ca39979659d90deef6c6830906c07b3fce56 (diff) |
Merge pull request #2820 from rust-analyzer/releases
GitHub releases
-rw-r--r-- | .github/workflows/release.yaml | 111 |
1 files changed, 98 insertions, 13 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 49d3ee0e9..95b56cebc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml | |||
@@ -5,8 +5,8 @@ on: | |||
5 | - release | 5 | - release |
6 | 6 | ||
7 | jobs: | 7 | jobs: |
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: |
@@ -35,13 +35,12 @@ jobs: | |||
35 | toolchain: stable | 35 | toolchain: stable |
36 | profile: minimal | 36 | profile: minimal |
37 | override: true | 37 | override: true |
38 | components: rustfmt, rust-src | ||
39 | 38 | ||
40 | - name: Build | 39 | - name: Build |
41 | uses: actions-rs/cargo@v1 | 40 | uses: actions-rs/cargo@v1 |
42 | with: | 41 | with: |
43 | command: build | 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 | - name: Strip symbols | 45 | - name: Strip symbols |
47 | if: matrix.os == 'ubuntu-latest' | 46 | if: matrix.os == 'ubuntu-latest' |
@@ -50,13 +49,17 @@ jobs: | |||
50 | - name: Create distribution dir | 49 | - name: Create distribution dir |
51 | run: mkdir ./dist | 50 | run: mkdir ./dist |
52 | 51 | ||
53 | - name: Copy binaries (unix) | 52 | - name: Copy binary |
54 | if: matrix.os != 'windows-latest' | 53 | if: matrix.os == 'ubuntu-latest' |
55 | run: cp ./target/release/ra_lsp_server ./dist | 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 | if: matrix.os == 'windows-latest' | 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 | - name: Upload artifacts | 64 | - name: Upload artifacts |
62 | uses: actions/upload-artifact@v1 | 65 | uses: actions/upload-artifact@v1 |
@@ -64,8 +67,8 @@ jobs: | |||
64 | name: server-${{ matrix.os }} | 67 | name: server-${{ matrix.os }} |
65 | path: ./dist | 68 | path: ./dist |
66 | 69 | ||
67 | type-script: | 70 | build-clients: |
68 | name: TypeScript | 71 | name: build-clients |
69 | runs-on: ubuntu-latest | 72 | runs-on: ubuntu-latest |
70 | steps: | 73 | steps: |
71 | - name: Checkout repository | 74 | - name: Checkout repository |
@@ -83,13 +86,95 @@ jobs: | |||
83 | working-directory: ./editors/code | 86 | working-directory: ./editors/code |
84 | 87 | ||
85 | - name: Copy vscode extension | 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 | - name: Copy emacs mode | 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 | - name: Upload artifacts | 94 | - name: Upload artifacts |
92 | uses: actions/upload-artifact@v1 | 95 | uses: actions/upload-artifact@v1 |
93 | with: | 96 | with: |
94 | name: editor-plugins | 97 | name: editor-plugins |
95 | path: ./dist | 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 | - uses: actions/[email protected] | ||
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 | - uses: actions/[email protected] | ||
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 | - uses: actions/[email protected] | ||
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 | - uses: actions/[email protected] | ||
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 | - uses: actions/[email protected] | ||
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 | ||