4 - cron: '0 0 * * *' # midnight UTC
14 runs-on: ${{ matrix.os }}
17 os: [ubuntu-latest, windows-latest, macos-latest]
20 RUSTFLAGS: -D warnings
22 RUSTUP_MAX_RETRIES: 10
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: github.ref == 'refs/heads/release'
53 run: cargo xtask dist --version 0.2.$GITHUB_RUN_NUMBER --tag $(date --iso --utc)
56 if: github.ref != 'refs/heads/release'
57 run: cargo xtask dist --version 0.3.$GITHUB_RUN_NUMBER-nightly --tag nightly
59 - name: Upload artifacts
60 uses: actions/upload-artifact@v1
62 name: dist-${{ matrix.os }}
67 runs-on: ubuntu-latest
70 - name: Install Nodejs
71 uses: actions/setup-node@v1
75 - run: echo "::set-env name=TAG::$(date --iso --utc)"
76 if: github.ref == 'refs/heads/release'
77 - run: echo "::set-env name=TAG::nightly"
78 if: github.ref != 'refs/heads/release'
79 - run: 'echo "TAG: $TAG"'
81 - name: Checkout repository
82 uses: actions/checkout@v2
84 - uses: actions/download-artifact@v1
86 name: dist-macos-latest
88 - uses: actions/download-artifact@v1
90 name: dist-ubuntu-latest
92 - uses: actions/download-artifact@v1
94 name: dist-windows-latest
98 - name: Publish Release
99 uses: ./.github/actions/github-release
103 token: ${{ secrets.GITHUB_TOKEN }}
106 working-directory: ./editors/code
108 - name: Publish Extension
109 if: github.ref == 'refs/heads/release'
110 working-directory: ./editors/code
111 # token from https://dev.azure.com/rust-analyzer/
112 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix