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: matrix.os == 'ubuntu-latest'
46 run: cargo build --package rust-analyzer --bin rust-analyzer --release --target x86_64-unknown-linux-musl
51 if: matrix.os != 'ubuntu-latest'
52 run: cargo build --package rust-analyzer --bin rust-analyzer --release
54 - name: Create distribution dir
58 if: matrix.os == 'ubuntu-latest'
59 run: cp ./target/x86_64-unknown-linux-musl/release/rust-analyzer ./dist/rust-analyzer-linux && strip ./dist/rust-analyzer-linux
62 if: matrix.os == 'macos-latest'
63 run: cp ./target/release/rust-analyzer ./dist/rust-analyzer-mac
66 if: matrix.os == 'windows-latest'
67 run: copy ./target/release/rust-analyzer.exe ./dist/rust-analyzer-windows.exe
69 - name: Upload artifacts
70 uses: actions/upload-artifact@v1
72 name: server-${{ matrix.os }}
77 runs-on: ubuntu-latest
79 - name: Checkout repository
80 uses: actions/checkout@v1
82 - name: Install Nodejs
83 uses: actions/setup-node@v1
88 working-directory: ./editors/code
90 - run: npm run package --scripts-prepend-node-path
91 working-directory: ./editors/code
93 - name: Copy vscode extension
94 run: mkdir -p ./dist/code && cp ./editors/code/rust-analyzer.vsix ./dist/
96 - name: Upload artifacts
97 uses: actions/upload-artifact@v1
104 runs-on: ubuntu-latest
105 needs: ['build-server', 'build-clients']
107 - name: Install Nodejs
108 uses: actions/setup-node@v1
112 - run: echo "::set-env name=TAG::$(date --iso)"
113 if: github.event_name == 'push'
114 - run: echo "::set-env name=TAG::nightly"
115 if: github.event_name != 'push'
116 - run: 'echo "TAG: $TAG"'
118 - name: Checkout repository
119 uses: actions/checkout@v1
121 - uses: actions/download-artifact@v1
125 - uses: actions/download-artifact@v1
127 name: server-macos-latest
129 - uses: actions/download-artifact@v1
131 name: server-ubuntu-latest
133 - uses: actions/download-artifact@v1
135 name: server-windows-latest
137 - run: ls -all ./dist
139 - name: Publish Release
140 uses: ./.github/actions/github-release
144 token: ${{ secrets.GITHUB_TOKEN }}
147 working-directory: ./editors/code
149 - name: Publish Extension
150 if: github.event_name == 'push'
151 working-directory: ./editors/code
152 # token from https://dev.azure.com/rust-analyzer/
153 run: npx vsce publish 0.1.$(date +%Y%m%d) --pat ${{ secrets.MARKETPLACE_TOKEN }}