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: 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: Upload artifacts
64 uses: actions/upload-artifact@v1
66 name: dist-${{ matrix.os }}
71 runs-on: ubuntu-latest
74 - name: Install Nodejs
75 uses: actions/setup-node@v1
79 - run: echo "::set-env name=TAG::$(date --iso --utc)"
80 if: github.ref == 'refs/heads/release'
81 - run: echo "::set-env name=TAG::nightly"
82 if: github.ref != 'refs/heads/release'
83 - run: 'echo "TAG: $TAG"'
85 - name: Checkout repository
86 uses: actions/checkout@v2
88 - uses: actions/download-artifact@v1
90 name: dist-macos-latest
92 - uses: actions/download-artifact@v1
94 name: dist-ubuntu-latest
96 - uses: actions/download-artifact@v1
98 name: dist-windows-latest
100 - run: ls -all ./dist
102 - name: Publish Release
103 uses: ./.github/actions/github-release
107 token: ${{ secrets.GITHUB_TOKEN }}
110 working-directory: ./editors/code
112 - name: Publish Extension
113 if: github.ref == 'refs/heads/release'
114 working-directory: ./editors/code
115 # token from https://dev.azure.com/rust-analyzer/
116 run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer.vsix