4 - cron: '0 0 * * *' # midnight UTC
14 RUSTFLAGS: "-D warnings -W unreachable-pub"
15 RUSTUP_MAX_RETRIES: 10
16 FETCH_DEPTH: 0 # pull in the tags for the version string
19 dist-x86_64-pc-windows-msvc:
20 name: dist (x86_64-pc-windows-msvc)
21 runs-on: windows-latest
23 RA_TARGET: x86_64-pc-windows-msvc
26 - name: Checkout repository
27 uses: actions/checkout@v2
29 fetch-depth: ${{ env.FETCH_DEPTH }}
31 # We need to disable the existing toolchain to avoid updating rust-docs
32 # which takes a long time. The fastest way to do this is to rename the
33 # existing folder, as deleting it takes about as much time as not doing
34 # anything and just updating rust-docs.
35 - name: Rename existing rust toolchain
36 run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
38 - name: Install Rust toolchain
39 uses: actions-rs/toolchain@v1
48 - name: Upload artifacts
49 uses: actions/upload-artifact@v1
51 name: dist-x86_64-pc-windows-msvc
54 dist-aarch64-pc-windows-msvc:
55 name: dist (aarch64-pc-windows-msvc)
56 runs-on: windows-latest
58 RA_TARGET: aarch64-pc-windows-msvc
61 - name: Checkout repository
62 uses: actions/checkout@v2
64 fetch-depth: ${{ env.FETCH_DEPTH }}
66 - name: Rename existing rust toolchain
67 run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
69 - name: Install Rust toolchain
70 uses: actions-rs/toolchain@v1
73 target: aarch64-pc-windows-msvc
80 - name: Upload artifacts
81 uses: actions/upload-artifact@v1
83 name: dist-aarch64-pc-windows-msvc
86 dist-x86_64-unknown-linux-gnu:
87 name: dist (x86_64-unknown-linux-gnu)
90 RA_TARGET: x86_64-unknown-linux-gnu
93 - name: Checkout repository
94 uses: actions/checkout@v2
96 fetch-depth: ${{ env.FETCH_DEPTH }}
98 - name: Install Rust toolchain
99 uses: actions-rs/toolchain@v1
106 - name: Install Nodejs
107 uses: actions/setup-node@v1
112 run: cargo xtask dist --client-patch-version $GITHUB_RUN_NUMBER
114 - name: Run analysis-stats on rust-analyzer
115 run: target/${{ env.RA_TARGET }}/release/rust-analyzer analysis-stats .
117 - name: Run analysis-stats on rust std library
118 run: target/${{ env.RA_TARGET }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
120 - name: Upload artifacts
121 uses: actions/upload-artifact@v1
123 name: dist-x86_64-unknown-linux-gnu
126 dist-x86_64-unknown-linux-musl:
127 name: dist (x86_64-unknown-linux-musl)
128 runs-on: ubuntu-20.04
130 RA_TARGET: x86_64-unknown-linux-musl
131 # For some reason `-crt-static` is not working for clang without lld
132 RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
136 - /usr/local/cargo/registry
139 - name: Install dependencies
140 run: apk add --no-cache git clang lld musl-dev
142 - name: Checkout repository
143 uses: actions/checkout@v2
145 fetch-depth: ${{ env.FETCH_DEPTH }}
148 run: cargo xtask dist
150 - name: Upload artifacts
151 uses: actions/upload-artifact@v1
153 name: dist-x86_64-unknown-linux-musl
156 dist-aarch64-unknown-linux-gnu:
157 name: dist (aarch64-unknown-linux-gnu)
158 runs-on: ubuntu-16.04
160 RA_TARGET: aarch64-unknown-linux-gnu
161 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
164 - name: Checkout repository
165 uses: actions/checkout@v2
167 fetch-depth: ${{ env.FETCH_DEPTH }}
169 - name: Install Rust toolchain
170 uses: actions-rs/toolchain@v1
173 target: aarch64-unknown-linux-gnu
177 - name: Install target toolchain
178 run: sudo apt-get install gcc-aarch64-linux-gnu
181 run: cargo xtask dist
183 - name: Upload artifacts
184 uses: actions/upload-artifact@v1
186 name: dist-aarch64-unknown-linux-gnu
189 dist-x86_64-apple-darwin:
190 name: dist (x86_64-apple-darwin)
191 runs-on: macos-latest
193 RA_TARGET: x86_64-apple-darwin
194 SELECT_XCODE: /Applications/Xcode_12.2.app
197 - name: Select XCode version
198 run: sudo xcode-select -s "${SELECT_XCODE}"
200 - name: Checkout repository
201 uses: actions/checkout@v2
203 fetch-depth: ${{ env.FETCH_DEPTH }}
205 - name: Install Rust toolchain
206 uses: actions-rs/toolchain@v1
213 run: cargo xtask dist
215 - name: Upload artifacts
216 uses: actions/upload-artifact@v1
218 name: dist-x86_64-apple-darwin
221 dist-aarch64-apple-darwin:
222 name: dist (aarch64-apple-darwin)
223 runs-on: macos-latest
225 RA_TARGET: aarch64-apple-darwin
226 SELECT_XCODE: /Applications/Xcode_12.2.app
229 - name: Select XCode version
230 run: sudo xcode-select -s "${SELECT_XCODE}"
232 - name: Checkout repository
233 uses: actions/checkout@v2
235 fetch-depth: ${{ env.FETCH_DEPTH }}
237 - name: Install Rust toolchain
238 uses: actions-rs/toolchain@v1
241 target: aarch64-apple-darwin
246 run: SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) cargo xtask dist
248 - name: Upload artifacts
249 uses: actions/upload-artifact@v1
251 name: dist-aarch64-apple-darwin
256 runs-on: ubuntu-16.04
257 needs: ['dist-x86_64-pc-windows-msvc', 'dist-aarch64-pc-windows-msvc', 'dist-x86_64-unknown-linux-gnu', 'dist-x86_64-unknown-linux-musl', 'dist-aarch64-unknown-linux-gnu', 'dist-x86_64-apple-darwin', 'dist-aarch64-apple-darwin']
259 - name: Install Nodejs
260 uses: actions/setup-node@v1
264 - run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
265 if: github.ref == 'refs/heads/release'
266 - run: echo "TAG=nightly" >> $GITHUB_ENV
267 if: github.ref != 'refs/heads/release'
268 - run: 'echo "TAG: $TAG"'
270 - name: Checkout repository
271 uses: actions/checkout@v2
273 fetch-depth: ${{ env.FETCH_DEPTH }}
275 - run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
276 - run: 'echo "HEAD_SHA: $HEAD_SHA"'
278 - uses: actions/download-artifact@v1
280 name: dist-aarch64-apple-darwin
282 - uses: actions/download-artifact@v1
284 name: dist-x86_64-apple-darwin
286 - uses: actions/download-artifact@v1
288 name: dist-x86_64-unknown-linux-gnu
290 - uses: actions/download-artifact@v1
292 name: dist-x86_64-unknown-linux-musl
294 - uses: actions/download-artifact@v1
296 name: dist-aarch64-unknown-linux-gnu
298 - uses: actions/download-artifact@v1
300 name: dist-x86_64-pc-windows-msvc
302 - uses: actions/download-artifact@v1
304 name: dist-aarch64-pc-windows-msvc
308 - name: Publish Release
309 uses: ./.github/actions/github-release
313 token: ${{ secrets.GITHUB_TOKEN }}
316 working-directory: ./editors/code
318 - name: Publish Extension
319 if: github.ref == 'refs/heads/release'
320 working-directory: ./editors/code
321 # token from https://dev.azure.com/rust-analyzer/
322 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix