-
Notifications
You must be signed in to change notification settings - Fork 13
130 lines (111 loc) · 3.23 KB
/
release-cddl.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Draft release
on:
push:
branches:
- main
paths-ignore:
- ".github/workflows/release-vscode-extension.yml"
- "cddl-lsp/**"
jobs:
compilation-check:
uses: anweiss/cddl/.github/workflows/compilation-check.yml@main
cargo-publish-dry-run:
name: Cargo publish dry run
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: cargo publish --dry-run
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run
wasm-compilation-check:
name: Compilation check for wasm target and npm publishing
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Install wasmpack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Build wasm default features
run: |
wasm-pack build --target nodejs --scope anweiss --release
- name: Build wasm lsp feature
run: |
wasm-pack build --target nodejs --scope anweiss --release --out-dir cddl-languageserver -- --features lsp
sed -i -e 's/"name": "@anweiss\/cddl"/"name": "@anweiss\/cddl-languageserver"/g' cddl-languageserver/package.json
- name: npm publish dry run
run: |
cd pkg
npm publish --access=public --dry-run
cd ../cddl-languageserver
npm publish --access=public --dry-run
website-build-check:
name: Build website
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Install wasmpack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install node
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Build wasm
run: |
wasm-pack build --release
- name: Build web
run: |
cd www
npm install
npm run build
draft-release:
name: Draft Release
needs:
[
compilation-check,
cargo-publish-dry-run,
wasm-compilation-check,
website-build-check,
]
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Draft Release
id: draft_release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: ${{ startsWith(github.ref, 'refs/tags') }}