4 - cron: '0 0 * * *' # midnight UTC
14 RUSTFLAGS: "-D warnings -W unreachable-pub"
15 RUSTUP_MAX_RETRIES: 10
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 if: github.ref == 'refs/heads/release'
113 run: cargo xtask dist --client 0.2.$GITHUB_RUN_NUMBER
116 if: github.ref != 'refs/heads/release'
117 run: cargo xtask dist --nightly --client 0.3.$GITHUB_RUN_NUMBER-nightly
119 - name: Run analysis-stats on rust-analyzer
120 run: target/${{ env.RA_TARGET }}/release/rust-analyzer analysis-stats .
122 - name: Run analysis-stats on rust std library
123 run: target/${{ env.RA_TARGET }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std
125 - name: Upload artifacts
126 uses: actions/upload-artifact@v1
128 name: dist-x86_64-unknown-linux-gnu
131 dist-x86_64-unknown-linux-musl:
132 name: dist (x86_64-unknown-linux-musl)
133 runs-on: ubuntu-20.04
135 RA_TARGET: x86_64-unknown-linux-musl
136 # For some reason `-crt-static` is not working for clang without lld
137 RUSTFLAGS: "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static"
141 - /usr/local/cargo/registry
144 - name: Install dependencies
145 run: apk add --no-cache git clang lld musl-dev
147 - name: Checkout repository
148 uses: actions/checkout@v2
150 fetch-depth: ${{ env.FETCH_DEPTH }}
153 run: cargo xtask dist
155 - name: Upload artifacts
156 uses: actions/upload-artifact@v1
158 name: dist-x86_64-unknown-linux-musl
161 dist-aarch64-unknown-linux-gnu:
162 name: dist (aarch64-unknown-linux-gnu)
163 runs-on: ubuntu-16.04
165 RA_TARGET: aarch64-unknown-linux-gnu
166 CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
169 - name: Checkout repository
170 uses: actions/checkout@v2
172 fetch-depth: ${{ env.FETCH_DEPTH }}
174 - name: Install Rust toolchain
175 uses: actions-rs/toolchain@v1
178 target: aarch64-unknown-linux-gnu
182 - name: Install target toolchain
183 run: sudo apt-get install gcc-aarch64-linux-gnu
186 run: cargo xtask dist
188 - name: Upload artifacts
189 uses: actions/upload-artifact@v1
191 name: dist-aarch64-unknown-linux-gnu
194 dist-x86_64-apple-darwin:
195 name: dist (x86_64-apple-darwin)
196 runs-on: macos-latest
198 RA_TARGET: x86_64-apple-darwin
199 SELECT_XCODE: /Applications/Xcode_12.2.app
202 - name: Select XCode version
203 run: sudo xcode-select -s "${SELECT_XCODE}"
205 - name: Checkout repository
206 uses: actions/checkout@v2
208 fetch-depth: ${{ env.FETCH_DEPTH }}
210 - name: Install Rust toolchain
211 uses: actions-rs/toolchain@v1
218 run: cargo xtask dist
220 - name: Upload artifacts
221 uses: actions/upload-artifact@v1
223 name: dist-x86_64-apple-darwin
226 dist-aarch64-apple-darwin:
227 name: dist (aarch64-apple-darwin)
228 runs-on: macos-latest
230 RA_TARGET: aarch64-apple-darwin
231 SELECT_XCODE: /Applications/Xcode_12.2.app
234 - name: Select XCode version
235 run: sudo xcode-select -s "${SELECT_XCODE}"
237 - name: Checkout repository
238 uses: actions/checkout@v2
240 fetch-depth: ${{ env.FETCH_DEPTH }}
242 - name: Install Rust toolchain
243 uses: actions-rs/toolchain@v1
246 target: aarch64-apple-darwin
251 run: SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) cargo xtask dist
253 - name: Upload artifacts
254 uses: actions/upload-artifact@v1
256 name: dist-aarch64-apple-darwin
261 runs-on: ubuntu-16.04
262 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']
264 - name: Install Nodejs
265 uses: actions/setup-node@v1
269 - run: echo "TAG=$(date --iso --utc)" >> $GITHUB_ENV
270 if: github.ref == 'refs/heads/release'
271 - run: echo "TAG=nightly" >> $GITHUB_ENV
272 if: github.ref != 'refs/heads/release'
273 - run: 'echo "TAG: $TAG"'
275 - name: Checkout repository
276 uses: actions/checkout@v2
278 fetch-depth: ${{ env.FETCH_DEPTH }}
280 - run: echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
281 - run: 'echo "HEAD_SHA: $HEAD_SHA"'
283 - uses: actions/download-artifact@v1
285 name: dist-aarch64-apple-darwin
287 - uses: actions/download-artifact@v1
289 name: dist-x86_64-apple-darwin
291 - uses: actions/download-artifact@v1
293 name: dist-x86_64-unknown-linux-gnu
295 - uses: actions/download-artifact@v1
297 name: dist-x86_64-unknown-linux-musl
299 - uses: actions/download-artifact@v1
301 name: dist-aarch64-unknown-linux-gnu
303 - uses: actions/download-artifact@v1
305 name: dist-x86_64-pc-windows-msvc
307 - uses: actions/download-artifact@v1
309 name: dist-aarch64-pc-windows-msvc
313 - name: Publish Release
314 uses: ./.github/actions/github-release
318 token: ${{ secrets.GITHUB_TOKEN }}
321 working-directory: ./editors/code
323 - name: Publish Extension
324 if: github.ref == 'refs/heads/release'
325 working-directory: ./editors/code
326 # token from https://dev.azure.com/rust-analyzer/
327 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix