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-aarch64-unknown-linux-gnu:
127 name: dist (aarch64-unknown-linux-gnu)
128 runs-on: ubuntu-20.04
130 RA_TARGET: aarch64-unknown-linux-gnu
131 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
134 - name: Checkout repository
135 uses: actions/checkout@v2
137 fetch-depth: ${{ env.FETCH_DEPTH }}
139 - name: Install Rust toolchain
140 uses: actions-rs/toolchain@v1
143 target: aarch64-unknown-linux-gnu
147 - name: Update apt repositories
148 run: sudo apt-get update
150 - name: Install target toolchain
151 run: sudo apt-get install gcc-aarch64-linux-gnu
154 run: cargo xtask dist
156 - name: Upload artifacts
157 uses: actions/upload-artifact@v1
159 name: dist-aarch64-unknown-linux-gnu
162 dist-x86_64-unknown-linux-musl:
163 name: dist (x86_64-unknown-linux-musl)
164 runs-on: ubuntu-latest
166 RA_TARGET: x86_64-unknown-linux-musl
167 # For some reason `-crt-static` is not working for clang without lld
168 RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
172 - /usr/local/cargo/registry
175 - name: Install dependencies
176 run: apk add --no-cache git clang lld musl-dev
178 - name: Checkout repository
179 uses: actions/checkout@v2
181 fetch-depth: ${{ env.FETCH_DEPTH }}
184 run: cargo xtask dist
186 - name: Upload artifacts
187 uses: actions/upload-artifact@v1
189 name: dist-x86_64-unknown-linux-musl
192 dist-x86_64-apple-darwin:
193 name: dist (x86_64-apple-darwin)
194 runs-on: macos-latest
196 RA_TARGET: x86_64-apple-darwin
197 # SELECT_XCODE: /Applications/Xcode_12.2.app
200 # use the default (12.5.1 as of today)
201 # - name: Select XCode version
202 # run: sudo xcode-select -s "${SELECT_XCODE}"
204 - name: Checkout repository
205 uses: actions/checkout@v2
207 fetch-depth: ${{ env.FETCH_DEPTH }}
209 - name: Install Rust toolchain
210 uses: actions-rs/toolchain@v1
217 run: cargo xtask dist
219 - name: Upload artifacts
220 uses: actions/upload-artifact@v1
222 name: dist-x86_64-apple-darwin
225 dist-aarch64-apple-darwin:
226 name: dist (aarch64-apple-darwin)
227 runs-on: macos-latest
229 RA_TARGET: aarch64-apple-darwin
230 SELECT_XCODE: /Applications/Xcode_12.2.app
233 - name: Select XCode version
234 run: sudo xcode-select -s "${SELECT_XCODE}"
236 - name: Checkout repository
237 uses: actions/checkout@v2
239 fetch-depth: ${{ env.FETCH_DEPTH }}
241 - name: Install Rust toolchain
242 uses: actions-rs/toolchain@v1
245 target: aarch64-apple-darwin
250 run: SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) cargo xtask dist
252 - name: Upload artifacts
253 uses: actions/upload-artifact@v1
255 name: dist-aarch64-apple-darwin
260 runs-on: ubuntu-latest
261 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']
263 - name: Install Nodejs
264 uses: actions/setup-node@v1
268 - run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
269 if: github.ref == 'refs/heads/release'
270 - run: echo "TAG=nightly" >> $GITHUB_ENV
271 if: github.ref != 'refs/heads/release'
272 - run: 'echo "TAG: $TAG"'
274 - name: Checkout repository
275 uses: actions/checkout@v2
277 fetch-depth: ${{ env.FETCH_DEPTH }}
279 - run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
280 - run: 'echo "HEAD_SHA: $HEAD_SHA"'
282 - uses: actions/download-artifact@v1
284 name: dist-aarch64-apple-darwin
286 - uses: actions/download-artifact@v1
288 name: dist-x86_64-apple-darwin
290 - uses: actions/download-artifact@v1
292 name: dist-x86_64-unknown-linux-gnu
294 - uses: actions/download-artifact@v1
296 name: dist-x86_64-unknown-linux-musl
298 - uses: actions/download-artifact@v1
300 name: dist-aarch64-unknown-linux-gnu
302 - uses: actions/download-artifact@v1
304 name: dist-x86_64-pc-windows-msvc
306 - uses: actions/download-artifact@v1
308 name: dist-aarch64-pc-windows-msvc
312 - name: Publish Release
313 uses: ./.github/actions/github-release
317 token: ${{ secrets.GITHUB_TOKEN }}
320 working-directory: ./editors/code
322 - name: Publish Extension
323 if: github.ref == 'refs/heads/release'
324 working-directory: ./editors/code
325 # token from https://dev.azure.com/rust-analyzer/
326 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix