4 - cron: '0 0 * * *' # midnight UTC
13 runs-on: ${{ matrix.os }}
16 os: [ubuntu-latest, windows-latest, macos-latest]
19 RUSTFLAGS: -D warnings
21 RUSTUP_MAX_RETRIES: 10
25 - name: Checkout repository
26 uses: actions/checkout@v1
28 # We need to disable the existing toolchain to avoid updating rust-docs
29 # which takes a long time. The fastest way to do this is to rename the
30 # existing folder, as deleting it takes about as much time as not doing
31 # anything and just updating rust-docs.
32 - name: Rename existing rust toolchain (Windows)
33 if: matrix.os == 'windows-latest'
34 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
36 - name: Install Rust toolchain
37 uses: actions-rs/toolchain@v1
41 target: x86_64-unknown-linux-musl
45 if: github.event_name == 'push'
49 if: github.event_name != 'push'
50 run: cargo xtask dist --nightly
52 - name: Upload artifacts
53 uses: actions/upload-artifact@v1
55 name: dist-${{ matrix.os }}
60 runs-on: ubuntu-latest
61 needs: ['build-server', 'build-clients']
63 - name: Install Nodejs
64 uses: actions/setup-node@v1
68 - run: echo "::set-env name=TAG::$(date --iso)"
69 if: github.event_name == 'push'
70 - run: echo "::set-env name=TAG::nightly"
71 if: github.event_name != 'push'
72 - run: 'echo "TAG: $TAG"'
74 - name: Checkout repository
75 uses: actions/checkout@v1
77 - uses: actions/download-artifact@v1
79 name: dist-macos-latest
81 - uses: actions/download-artifact@v1
83 name: dist-ubuntu-latest
85 - uses: actions/download-artifact@v1
87 name: dist-windows-latest
91 - name: Publish Release
92 uses: ./.github/actions/github-release
96 token: ${{ secrets.GITHUB_TOKEN }}
99 working-directory: ./editors/code
101 - name: Publish Extension
102 if: github.event_name == 'push'
103 working-directory: ./editors/code
104 # token from https://dev.azure.com/rust-analyzer/
105 run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix