fork/rust-analyzer
git clone https://git.julia.blue/fork/rust-analyzer
8e38833c36
master
1name : release 2on : 3schedule : 4- cron : "0 0 * * *" # midnight UTC 5 6workflow_dispatch : 7 8push : 9branches : 10- release 11- trigger-nightly 12 13env : 14CARGO_INCREMENTAL : 0 15CARGO_NET_RETRY : 10 16RUSTFLAGS : "-D warnings -W unreachable-pub" 17RUSTUP_MAX_RETRIES : 10 18FETCH_DEPTH : 0 # pull in the tags for the version string 19MACOSX_DEPLOYMENT_TARGET : 10.15 20CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER : aarch64-linux-gnu-gcc 21CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER : arm-linux-gnueabihf-gcc 22 23jobs : 24dist : 25strategy : 26matrix : 27include : 28- os : windows-latest 29target : x86_64-pc-windows-msvc 30code-target : win32-x64 31- os : windows-latest 32target : aarch64-pc-windows-msvc 33code-target : win32-arm64 34- os : ubuntu-18.04 35target : x86_64-unknown-linux-gnu 36code-target : linux-x64 37- os : ubuntu-18.04 38target : aarch64-unknown-linux-gnu 39code-target : linux-arm64 40- os : ubuntu-18.04 41target : arm-unknown-linux-gnueabihf 42code-target : linux-armhf 43- os : macos-11 44target : x86_64-apple-darwin 45code-target : darwin-x64 46- os : macos-11 47target : aarch64-apple-darwin 48code-target : darwin-arm64 49 50name : dist (${{ matrix.target }}) 51runs-on : ${{ matrix.os }} 52 53env : 54RA_TARGET : ${{ matrix.target }} 55 56steps : 57- name : Checkout repository 58uses : actions/checkout@v3 59with : 60fetch-depth : ${{ env.FETCH_DEPTH }} 61 62- name : Install Rust toolchain 63run : | 64rustup update --no-self-update stable 65rustup target add ${{ matrix.target }} 66rustup component add rust-src 67 68- name : Install Node.js 69uses : actions/setup-node@v1 70with : 71node-version : 14.x 72 73- name : Update apt repositories 74if : matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf' 75run : sudo apt-get update 76 77- name : Install AArch64 target toolchain 78if : matrix.target == 'aarch64-unknown-linux-gnu' 79run : sudo apt-get install gcc-aarch64-linux-gnu 80 81- name : Install ARM target toolchain 82if : matrix.target == 'arm-unknown-linux-gnueabihf' 83run : sudo apt-get install gcc-arm-linux-gnueabihf 84 85- name : Dist 86run : cargo xtask dist --client-patch-version ${{ github.run_number }} 87 88- run : npm ci 89working-directory : editors/code 90 91- name : Package Extension (release) 92if : github.ref == 'refs/heads/release' 93run : npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} 94working-directory : editors/code 95 96- name : Package Extension (nightly) 97if : github.ref != 'refs/heads/release' 98run : npx vsce package -o "../../dist/rust-analyzer-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} --pre-release 99working-directory : editors/code 100 101- if : matrix.target == 'x86_64-unknown-linux-gnu' 102run : rm -rf editors/code/server 103 104- if : matrix.target == 'x86_64-unknown-linux-gnu' && github.ref == 'refs/heads/release' 105run : npx vsce package -o ../../dist/rust-analyzer-no-server.vsix 106working-directory : editors/code 107 108- if : matrix.target == 'x86_64-unknown-linux-gnu' && github.ref != 'refs/heads/release' 109run : npx vsce package -o ../../dist/rust-analyzer-no-server.vsix --pre-release 110working-directory : editors/code 111 112- name : Run analysis-stats on rust-analyzer 113if : matrix.target == 'x86_64-unknown-linux-gnu' 114run : target/${{ matrix.target }}/release/rust-analyzer analysis-stats . 115 116- name : Run analysis-stats on rust std library 117if : matrix.target == 'x86_64-unknown-linux-gnu' 118run : target/${{ matrix.target }}/release/rust-analyzer analysis-stats --with-deps $(rustc --print sysroot)/lib/rustlib/src/rust/library/std 119 120- name : Upload artifacts 121uses : actions/upload-artifact@v1 122with : 123name : dist-${{ matrix.target }} 124path : ./dist 125 126dist-x86_64-unknown-linux-musl : 127name : dist (x86_64-unknown-linux-musl) 128runs-on : ubuntu-latest 129env : 130RA_TARGET : x86_64-unknown-linux-musl 131# For some reason `-crt-static` is not working for clang without lld 132RUSTFLAGS : "-C link-arg=-fuse-ld=lld -C target-feature=-crt-static" 133container : 134image : rust:alpine 135volumes : 136- /usr/local/cargo/registry 137 138steps : 139- name : Install dependencies 140run : apk add --no-cache git clang lld musl-dev nodejs npm 141 142- name : Checkout repository 143uses : actions/checkout@v3 144with : 145fetch-depth : ${{ env.FETCH_DEPTH }} 146 147- name : Dist 148run : cargo xtask dist --client-patch-version ${{ github.run_number }} 149 150- run : npm ci 151working-directory : editors/code 152 153- name : Package Extension (release) 154if : github.ref == 'refs/heads/release' 155run : npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 156working-directory : editors/code 157 158- name : Package Extension (nightly) 159if : github.ref != 'refs/heads/release' 160run : npx vsce package -o "../../dist/rust-analyzer-alpine-x64.vsix" --target alpine-x64 --pre-release 161working-directory : editors/code 162 163- run : rm -rf editors/code/server 164 165- name : Upload artifacts 166uses : actions/upload-artifact@v1 167with : 168name : dist-x86_64-unknown-linux-musl 169path : ./dist 170 171publish : 172name : publish 173runs-on : ubuntu-latest 174needs : [ "dist" , "dist-x86_64-unknown-linux-musl" ] 175steps : 176- name : Install Nodejs 177uses : actions/setup-node@v1 178with : 179node-version : 14.x 180 181- run : echo "TAG=$(date --iso -u)" >> $GITHUB_ENV 182if : github.ref == 'refs/heads/release' 183- run : echo "TAG=nightly" >> $GITHUB_ENV 184if : github.ref != 'refs/heads/release' 185- run : 'echo "TAG: $TAG"' 186 187- name : Checkout repository 188uses : actions/checkout@v3 189with : 190fetch-depth : ${{ env.FETCH_DEPTH }} 191 192- run : echo "HEAD_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV 193- run : 'echo "HEAD_SHA: $HEAD_SHA"' 194 195- uses : actions/download-artifact@v1 196with : 197name : dist-aarch64-apple-darwin 198path : dist 199- uses : actions/download-artifact@v1 200with : 201name : dist-x86_64-apple-darwin 202path : dist 203- uses : actions/download-artifact@v1 204with : 205name : dist-x86_64-unknown-linux-gnu 206path : dist 207- uses : actions/download-artifact@v1 208with : 209name : dist-x86_64-unknown-linux-musl 210path : dist 211- uses : actions/download-artifact@v1 212with : 213name : dist-aarch64-unknown-linux-gnu 214path : dist 215- uses : actions/download-artifact@v1 216with : 217name : dist-arm-unknown-linux-gnueabihf 218path : dist 219- uses : actions/download-artifact@v1 220with : 221name : dist-x86_64-pc-windows-msvc 222path : dist 223- uses : actions/download-artifact@v1 224with : 225name : dist-aarch64-pc-windows-msvc 226path : dist 227- run : ls -al ./dist 228 229- name : Publish Release 230uses : ./.github/actions/github-release 231with : 232files : "dist/*" 233name : ${{ env.TAG }} 234token : ${{ secrets.GITHUB_TOKEN }} 235 236- run : rm dist/rust-analyzer-no-server.vsix 237 238- run : npm ci 239working-directory : ./editors/code 240 241- name : Publish Extension (Code Marketplace, release) 242if : github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer') 243working-directory : ./editors/code 244# token from https://dev.azure.com/rust-analyzer/ 245run : npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix 246 247- name : Publish Extension (OpenVSX, release) 248if : github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer') 249working-directory : ./editors/code 250# token from https://dev.azure.com/rust-analyzer/ 251run : npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix 252 253- name : Publish Extension (Code Marketplace, nightly) 254if : github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer') 255working-directory : ./editors/code 256run : npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release 257 258- name : Publish Extension (OpenVSX, nightly) 259if : github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer') 260working-directory : ./editors/code 261run : npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release