Skip to content

Commit 973aa05

Browse files
committed
Split out into a release build as bins were not getting generated as cargo build wasn't run
1 parent 45b0e7a commit 973aa05

File tree

2 files changed

+131
-32
lines changed

2 files changed

+131
-32
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,6 @@ jobs:
7878
if: matrix.os == 'windows-latest'
7979
run: Remove-Item ./target/${{ env.PROFILE }}/xtask.exe
8080

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-
9881
type-script:
9982
name: TypeScript
10083
runs-on: ubuntu-latest
@@ -114,18 +97,3 @@ jobs:
11497
working-directory: ./editors/code
11598
- run: npm run package --scripts-prepend-node-path
11699
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

.github/workflows/release.yaml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)