4 - cron: '0 0 * * *' # midnight UTC
14 RUSTFLAGS: -D warnings
15 RUSTUP_MAX_RETRIES: 10
20 runs-on: ${{ matrix.os }}
23 os: [ubuntu-latest, windows-latest, macos-latest]
26 - name: Checkout repository
27 uses: actions/checkout@v2
29 # We need to disable the existing toolchain to avoid updating rust-docs
30 # which takes a long time. The fastest way to do this is to rename the
31 # existing folder, as deleting it takes about as much time as not doing
32 # anything and just updating rust-docs.
33 - name: Rename existing rust toolchain (Windows)
34 if: matrix.os == 'windows-latest'
35 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
37 - name: Install Rust toolchain
38 uses: actions-rs/toolchain@v1
42 target: x86_64-unknown-linux-musl
45 - name: Install Nodejs
46 if: matrix.os == 'ubuntu-latest'
47 uses: actions/setup-node@v1
52 if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/release'
53 run: cargo xtask dist --client --version 0.2.$GITHUB_RUN_NUMBER --tag $(date --iso --utc)
56 if: matrix.os == 'ubuntu-latest' && github.ref != 'refs/heads/release'
57 run: cargo xtask dist --client --version 0.3.$GITHUB_RUN_NUMBER-nightly --tag nightly
60 if: matrix.os != 'ubuntu-latest'
63 - name: Nightly analysis-stats check
64 if: matrix.os == 'ubuntu-latest' && if: github.ref != 'refs/heads/release'
65 run: ./dist/rust-analyzer analysis-stats .
67 - name: Upload artifacts
68 uses: actions/upload-artifact@v1
70 name: dist-${{ matrix.os }}
75 runs-on: ubuntu-latest
78 - name: Install Nodejs
79 uses: actions/setup-node@v1
83 - run: echo "::set-env name=TAG::$(date --iso --utc)"
84 if: github.ref == 'refs/heads/release'
85 - run: echo "::set-env name=TAG::nightly"
86 if: github.ref != 'refs/heads/release'
87 - run: 'echo "TAG: $TAG"'
89 - name: Checkout repository
90 uses: actions/checkout@v2
92 - uses: actions/download-artifact@v1
94 name: dist-macos-latest
96 - uses: actions/download-artifact@v1
98 name: dist-ubuntu-latest
100 - uses: actions/download-artifact@v1
102 name: dist-windows-latest
104 - run: ls -all ./dist
106 - name: Publish Release
107 uses: ./.github/actions/github-release
111 token: ${{ secrets.GITHUB_TOKEN }}
114 working-directory: ./editors/code
116 - name: Publish Extension
117 if: github.ref == 'refs/heads/release'
118 working-directory: ./editors/code
119 # token from https://dev.azure.com/rust-analyzer/
120 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix