diff options
-rw-r--r-- | .github/workflows/ci.yaml | 32 | ||||
-rw-r--r-- | .github/workflows/release.yaml | 131 |
2 files changed, 131 insertions, 32 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eab03f581..3a2bdb4a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml | |||
@@ -78,23 +78,6 @@ jobs: | |||
78 | if: matrix.os == 'windows-latest' | 78 | if: matrix.os == 'windows-latest' |
79 | run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe | 79 | run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe |
80 | 80 | ||
81 | - name: Creat distribution dir | ||
82 | run: mkdir ./dist | ||
83 | |||
84 | - name: Copy binaries (non-win) | ||
85 | if: matrix.os != 'windows-latest' | ||
86 | run: cp ./target/${{ env.PROFILE }}/ra_lsp_server* ./dist | ||
87 | |||
88 | - name: Copy binaries (win) | ||
89 | if: matrix.os == 'windows-latest' | ||
90 | run: copy ./target/${{ env.PROFILE }}/ra_lsp_server.* ./dist | ||
91 | |||
92 | - name: Upload artifacts | ||
93 | uses: actions/upload-artifact@v1 | ||
94 | with: | ||
95 | name: executables-${{ matrix.os }} | ||
96 | path: ./dist | ||
97 | |||
98 | type-script: | 81 | type-script: |
99 | name: TypeScript | 82 | name: TypeScript |
100 | runs-on: ubuntu-latest | 83 | runs-on: ubuntu-latest |
@@ -114,18 +97,3 @@ jobs: | |||
114 | working-directory: ./editors/code | 97 | working-directory: ./editors/code |
115 | - run: npm run package --scripts-prepend-node-path | 98 | - run: npm run package --scripts-prepend-node-path |
116 | working-directory: ./editors/code | 99 | working-directory: ./editors/code |
117 | |||
118 | - name: Create distribution directory | ||
119 | run: mkdir ./dist | ||
120 | |||
121 | - name: Copy vscode extension | ||
122 | run: mkdir ./dist/code && cp ./editors/code/*.vsix ./dist/code/ | ||
123 | |||
124 | - name: Copy emacs mode | ||
125 | run: cp -R ./editors/emacs ./dist/ | ||
126 | |||
127 | - name: Upload artifacts | ||
128 | uses: actions/upload-artifact@v1 | ||
129 | with: | ||
130 | name: editors | ||
131 | path: ./dist | ||
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 000000000..278f5a586 --- /dev/null +++ b/.github/workflows/release.yaml | |||
@@ -0,0 +1,131 @@ | |||
1 | name: CI | ||
2 | on: | ||
3 | pull_request: | ||
4 | push: | ||
5 | branches: | ||
6 | - master | ||
7 | - staging | ||
8 | - trying | ||
9 | |||
10 | jobs: | ||
11 | rust: | ||
12 | name: Rust | ||
13 | runs-on: ${{ matrix.os }} | ||
14 | strategy: | ||
15 | matrix: | ||
16 | os: [ubuntu-latest, windows-latest, macos-latest] | ||
17 | env: | ||
18 | RUSTFLAGS: -D warnings | ||
19 | CARGO_INCREMENTAL: 0 | ||
20 | RUN_SLOW_TESTS: 1 | ||
21 | RUSTUP_MAX_RETRIES: 10 | ||
22 | CARGO_NET_RETRY: 10 | ||
23 | PROFILE: release | ||
24 | steps: | ||
25 | |||
26 | - name: Checkout repository | ||
27 | uses: actions/checkout@v1 | ||
28 | |||
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 | ||
36 | |||
37 | - name: Install Rust toolchain | ||
38 | uses: actions-rs/toolchain@v1 | ||
39 | with: | ||
40 | toolchain: stable | ||
41 | profile: minimal | ||
42 | override: true | ||
43 | components: rustfmt, rust-src | ||
44 | |||
45 | - name: Cache cargo registry | ||
46 | uses: actions/cache@v1 | ||
47 | with: | ||
48 | path: ~/.cargo/registry | ||
49 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
50 | |||
51 | - name: Cache cargo index | ||
52 | uses: actions/cache@v1 | ||
53 | with: | ||
54 | path: ~/.cargo/git | ||
55 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
56 | |||
57 | - name: Cache cargo target dir | ||
58 | uses: actions/cache@v1 | ||
59 | with: | ||
60 | path: target | ||
61 | key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | ||
62 | |||
63 | - name: Compile | ||
64 | uses: actions-rs/cargo@v1 | ||
65 | with: | ||
66 | command: build | ||
67 | args: --release | ||
68 | |||
69 | - name: Test | ||
70 | uses: actions-rs/cargo@v1 | ||
71 | with: | ||
72 | command: test | ||
73 | |||
74 | - name: Prepare cache | ||
75 | run: cargo xtask pre-cache | ||
76 | |||
77 | - name: Prepare cache 2 | ||
78 | if: matrix.os == 'windows-latest' | ||
79 | run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe | ||
80 | |||
81 | - name: Creat distribution dir | ||
82 | run: mkdir ./dist | ||
83 | |||
84 | - name: Copy binaries (non-win) | ||
85 | if: matrix.os != 'windows-latest' | ||
86 | run: cp ./target/${{ env.PROFILE }}/ra_lsp_server* ./dist | ||
87 | |||
88 | - name: Copy binaries (win) | ||
89 | if: matrix.os == 'windows-latest' | ||
90 | run: copy ./target/${{ env.PROFILE }}/ra_lsp_server.* ./dist | ||
91 | |||
92 | - name: Upload artifacts | ||
93 | uses: actions/upload-artifact@v1 | ||
94 | with: | ||
95 | name: executables-${{ matrix.os }} | ||
96 | path: ./dist | ||
97 | |||
98 | type-script: | ||
99 | name: TypeScript | ||
100 | runs-on: ubuntu-latest | ||
101 | env: | ||
102 | CXX: g++-4.9 | ||
103 | CC: gcc-4.9 | ||
104 | steps: | ||
105 | - name: Checkout repository | ||
106 | uses: actions/checkout@v1 | ||
107 | |||
108 | - name: Install Nodejs | ||
109 | uses: actions/setup-node@v1 | ||
110 | with: | ||
111 | node-version: 12.x | ||
112 | |||
113 | - run: npm ci | ||
114 | working-directory: ./editors/code | ||
115 | - run: npm run package --scripts-prepend-node-path | ||
116 | working-directory: ./editors/code | ||
117 | |||
118 | - name: Create distribution directory | ||
119 | run: mkdir ./dist | ||
120 | |||
121 | - name: Copy vscode extension | ||
122 | run: mkdir ./dist/code && cp ./editors/code/*.vsix ./dist/code/ | ||
123 | |||
124 | - name: Copy emacs mode | ||
125 | run: cp -R ./editors/emacs ./dist/ | ||
126 | |||
127 | - name: Upload artifacts | ||
128 | uses: actions/upload-artifact@v1 | ||
129 | with: | ||
130 | name: editors | ||
131 | path: ./dist | ||