4 - cron: '0 0 * * *' # midnight UTC
14 RUSTFLAGS: -D warnings
15 RUSTUP_MAX_RETRIES: 10
20 runs-on: ${{ matrix.os }}
23 os: [ubuntu-16.04, 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
44 - name: Install Nodejs
45 if: matrix.os == 'ubuntu-16.04'
46 uses: actions/setup-node@v1
51 if: matrix.os == 'ubuntu-16.04' && github.ref == 'refs/heads/release'
52 run: cargo xtask dist --client 0.2.$GITHUB_RUN_NUMBER
55 if: matrix.os == 'ubuntu-16.04' && github.ref != 'refs/heads/release'
56 run: cargo xtask dist --nightly --client 0.3.$GITHUB_RUN_NUMBER-nightly
59 if: matrix.os != 'ubuntu-16.04'
62 - name: Nightly analysis-stats check
63 if: matrix.os == 'ubuntu-16.04' && github.ref != 'refs/heads/release'
64 run: ./dist/rust-analyzer-linux analysis-stats .
66 - name: Upload artifacts
67 uses: actions/upload-artifact@v1
69 name: dist-${{ matrix.os }}
77 - name: Install Nodejs
78 uses: actions/setup-node@v1
82 - run: echo "::set-env name=TAG::$(date --iso --utc)"
83 if: github.ref == 'refs/heads/release'
84 - run: echo "::set-env name=TAG::nightly"
85 if: github.ref != 'refs/heads/release'
86 - run: 'echo "TAG: $TAG"'
88 - name: Checkout repository
89 uses: actions/checkout@v2
91 - run: echo "::set-env name=HEAD_SHA::$(git rev-parse HEAD)"
92 - run: 'echo "HEAD_SHA: $HEAD_SHA"'
94 - uses: actions/download-artifact@v1
96 name: dist-macos-latest
98 - uses: actions/download-artifact@v1
100 name: dist-ubuntu-16.04
102 - uses: actions/download-artifact@v1
104 name: dist-windows-latest
106 - run: ls -all ./dist
108 - name: Publish Release
109 uses: ./.github/actions/github-release
113 token: ${{ secrets.GITHUB_TOKEN }}
116 working-directory: ./editors/code
118 - name: Publish Extension
119 if: github.ref == 'refs/heads/release'
120 working-directory: ./editors/code
121 # token from https://dev.azure.com/rust-analyzer/
122 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix