Skip to content

Commit d201685

Browse files
committed
Add: automate build process
1 parent 5071c7d commit d201685

File tree

6 files changed

+322
-324
lines changed

6 files changed

+322
-324
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# # `npm-build.yml` - Build JavaScript bundle containing the CodeChat Editor Client.
2-
name: NPM build
1+
# # `host.yml` - Run build steps after `cargo dist build`.
2+
name: Host
33

44
on:
55
# Defining workflow_call means that this workflow can be called from
@@ -19,8 +19,8 @@ jobs:
1919
env:
2020
PLAN: ${{ inputs.plan }}
2121
steps:
22-
- name: NPM build
22+
- name: cargo build
2323
run: |
24-
cd client
25-
npm run dist
26-
echo "Plan is: ${PLAN}"
24+
echo "Plan is: ${PLAN}"
25+
cd server
26+
cargo run -- postrelease

.github/workflows/plan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# # `plan.yml` - Run build steps before `cargo dist build`.
2+
name: Plan
3+
4+
on:
5+
# Defining workflow_call means that this workflow can be called from
6+
# your main workflow job
7+
workflow_call:
8+
# cargo-dist exposes the plan from the plan step, as a JSON string,
9+
# to your job if it needs it
10+
inputs:
11+
plan:
12+
required: true
13+
type: string
14+
15+
jobs:
16+
greeter:
17+
runs-on: ubuntu-latest
18+
# This is optional; it exposes the plan to your job as an environment variable
19+
env:
20+
PLAN: ${{ inputs.plan }}
21+
steps:
22+
- name: cargo build
23+
run: |
24+
echo "Plan is: ${PLAN}"
25+
cd server
26+
cargo run -- prerelease

extensions/VSCode/developer.md

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,13 @@ To install from source:
2929

3030
- In the Client:
3131
- Update the version of the plugin in `package.json`.
32-
- Clean out `client/static/bundled`.
33-
- Run `npm update`.
34-
- Manually copy:
35-
- `client/node_modules/mathjax/` to `client/static`.
36-
- `client/node_modules/mathjax-modern-font/` to `client/static`.
37-
- `client/node_modules/graphviz-webcomponent/dist/renderer.min.js*` to
38-
`client/static/graphviz-webcomponent`.
39-
- Run `npm outdated` and check that everything is current.
40-
- Run `npm run dist`.
4132
- In the Server:
42-
- Run `cargo update`.
43-
- Run `cargo outdated` and check that everything is current.
44-
- Run `cargo test`.
45-
- Run `dist build`, then copy files to this extension.
33+
- Update the version in `cargo.toml`.
4634
- Here:
4735
- Update the version of the plugin in `package.json`.
48-
- Run `npm update`.
49-
- Run `npm outdated` and check that everything is current.
50-
- Verify that the extension still works after upgrading these packages.
51-
- Run `npx vsce publish --target win32-x64` (on Windows)
52-
- Repeat this for each target (e.g. `linux-x64`, `darwin-arm64`); however, use
53-
`npx vsce package --target blah` to produce a `.visx`, then
54-
`npx vsce publish --packagePath blah` on Windows. This is because simply
55-
copying the binary doesn't set the executable bit when publishing directly
56-
from Windows.
36+
- Run `cargo run -- release` on each platform, which produces a `.vsix` file for that platform
37+
- Run `npx vsce publish --packagePath blah`.
5738
([docs](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions))
58-
- Uncomment the ignore for `server/` in `.vscodeignore`.
59-
- Run `npx vsce publish`.
6039

6140
## Tests
6241

server/dist-workspace.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@ members = ["cargo:."]
2323
# Config for 'dist'
2424
[dist]
2525
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
26-
cargo-dist-version = "0.25.1"
26+
cargo-dist-version = "0.26.1"
2727
# Extra static files to include in each App (path relative to this Cargo.toml's dir)
2828
include = ["log4rs.yml", "hashLocations.json", "../client/static"]
2929
# The installers to generate for each app
3030
installers = []
3131
# Target platforms to build apps for (Rust target-triple syntax)
32-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
32+
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
3333
# CI backends to support
3434
ci = "github"
3535
# Which actions to run on pull requests
36-
pr-run-mode = "plan"
36+
pr-run-mode = "upload"
3737
# Skip checking whether the specified configuration files are up to date
3838
allow-dirty = ["ci"]
39-
# Publish jobs to run in CI
40-
publish-jobs = ["./npm-build"]
39+
# Plan jobs to run in CI
40+
plan-jobs = ["./plan"]
41+
# Host jobs to run in CI
42+
host-jobs = ["./host"]

0 commit comments

Comments
 (0)