diff options
author | Aleksey Kladov <[email protected]> | 2020-01-11 20:37:09 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-01-11 20:37:09 +0000 |
commit | 867081220921c1c593f11866bbdba8b845090c07 (patch) | |
tree | 150cef998b573729882fcd49fc01487ddea1acf5 /.github/workflows/release.yaml | |
parent | 7c1af25b228dd2d039dd7129aab5798fd18f0d6a (diff) | |
parent | 2187732fb5a4c9ae79a93b01cf82ec87f3750f9f (diff) |
Merge pull request #2766 from gilescope/windows-build
Upload PR
Diffstat (limited to '.github/workflows/release.yaml')
-rw-r--r-- | .github/workflows/release.yaml | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..6cb27482d --- /dev/null +++ b/.github/workflows/release.yaml | |||
@@ -0,0 +1,124 @@ | |||
1 | name: CI-Release | ||
2 | on: | ||
3 | pull_request: | ||
4 | push: | ||
5 | branches: | ||
6 | - master | ||
7 | |||
8 | jobs: | ||
9 | rust: | ||
10 | name: Rust | ||
11 | runs-on: ${{ matrix.os }} | ||
12 | strategy: | ||
13 | matrix: | ||
14 | os: [ubuntu-latest, windows-latest, macos-latest] | ||
15 | env: | ||
16 | RUSTFLAGS: -D warnings | ||
17 | CARGO_INCREMENTAL: 0 | ||
18 | RUN_SLOW_TESTS: 1 | ||
19 | RUSTUP_MAX_RETRIES: 10 | ||
20 | CARGO_NET_RETRY: 10 | ||
21 | PROFILE: release | ||
22 | steps: | ||
23 | |||
24 | - name: Checkout repository | ||
25 | uses: actions/checkout@v1 | ||
26 | |||
27 | # We need to disable the existing toolchain to avoid updating rust-docs | ||
28 | # which takes a long time. The fastest way to do this is to rename the | ||
29 | # existing folder, as deleting it takes about as much time as not doing | ||
30 | # anything and just updating rust-docs. | ||
31 | - name: Rename existing rust toolchain (Windows) | ||
32 | if: matrix.os == 'windows-latest' | ||
33 | 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 | ||
34 | |||
35 | - name: Install Rust toolchain | ||
36 | uses: actions-rs/toolchain@v1 | ||
37 | with: | ||
38 | toolchain: stable | ||
39 | profile: minimal | ||
40 | override: true | ||
41 | components: rustfmt, rust-src | ||
42 | |||
43 | - name: Cache cargo registry | ||
44 | uses: actions/cache@v1 | ||
45 | with: | ||
46 | path: ~/.cargo/registry | ||
47 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
48 | |||
49 | - name: Cache cargo index | ||
50 | uses: actions/cache@v1 | ||
51 | with: | ||
52 | path: ~/.cargo/git | ||
53 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
54 | |||
55 | - name: Cache cargo target dir | ||
56 | uses: actions/cache@v1 | ||
57 | with: | ||
58 | path: target | ||
59 | key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
60 | |||
61 | - name: Compile and Test | ||
62 | uses: actions-rs/cargo@v1 | ||
63 | with: | ||
64 | command: test | ||
65 | args: --release --all-targets | ||
66 | |||
67 | - name: Prepare cache | ||
68 | run: cargo xtask pre-cache | ||
69 | |||
70 | - name: Prepare cache 2 | ||
71 | if: matrix.os == 'windows-latest' | ||
72 | run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe | ||
73 | |||
74 | - name: Creat distribution dir | ||
75 | run: mkdir ./dist | ||
76 | |||
77 | - name: Copy binaries (non-win) | ||
78 | if: matrix.os != 'windows-latest' | ||
79 | run: cp ./target/${{ env.PROFILE }}/ra_lsp_server ./dist | ||
80 | |||
81 | - name: Copy binaries (win) | ||
82 | if: matrix.os == 'windows-latest' | ||
83 | run: copy ./target/${{ env.PROFILE }}/ra_lsp_server.* ./dist | ||
84 | |||
85 | - name: Upload artifacts | ||
86 | uses: actions/upload-artifact@v1 | ||
87 | with: | ||
88 | name: server-${{ matrix.os }} | ||
89 | path: ./dist | ||
90 | |||
91 | type-script: | ||
92 | name: TypeScript | ||
93 | runs-on: ubuntu-latest | ||
94 | env: | ||
95 | CXX: g++-4.9 | ||
96 | CC: gcc-4.9 | ||
97 | steps: | ||
98 | - name: Checkout repository | ||
99 | uses: actions/checkout@v1 | ||
100 | |||
101 | - name: Install Nodejs | ||
102 | uses: actions/setup-node@v1 | ||
103 | with: | ||
104 | node-version: 12.x | ||
105 | |||
106 | - run: npm ci | ||
107 | working-directory: ./editors/code | ||
108 | - run: npm run package --scripts-prepend-node-path | ||
109 | working-directory: ./editors/code | ||
110 | |||
111 | - name: Create distribution directory | ||
112 | run: mkdir ./dist | ||
113 | |||
114 | - name: Copy vscode extension | ||
115 | run: mkdir ./dist/code && cp ./editors/code/*.vsix ./dist/code/ | ||
116 | |||
117 | - name: Copy emacs mode | ||
118 | run: cp -R ./editors/emacs ./dist/ | ||
119 | |||
120 | - name: Upload artifacts | ||
121 | uses: actions/upload-artifact@v1 | ||
122 | with: | ||
123 | name: editors | ||
124 | path: ./dist | ||