-
Notifications
You must be signed in to change notification settings - Fork 19
129 lines (120 loc) · 3.76 KB
/
release.yaml
File metadata and controls
129 lines (120 loc) · 3.76 KB
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
name: Release
on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
env:
NODE_VERSION: "22"
RUST_VERSION: 1.84
jobs:
lint_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
shell: bash
run: |
rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update
rustup default ${{ env.RUST_VERSION }}
- name: Install Rust toolchain
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install latest Spin CLI
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Test
shell: bash
run: |
cd test
./test.sh
test_template:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install latest Spin CLI
uses: fermyon/actions/spin/setup@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install templates
run: spin templates install --dir .
- name: Create new project
run: spin new -t http-ts test-project -a
- name: Install dependencies of the test project
run: |
cd test-project
npm install
- name: Add new component to project
run: |
cd test-project
spin add -t http-ts new-component -a
cd new-component
npm install
- name: Build the application
run: |
cd test-project
spin build
build_docs:
runs-on: ubuntu-latest
needs: lint_and_test # later we want this after publishing to npmjs
steps:
- name: Checkout Repository including Tags
uses: actions/checkout@v6
- name: Install Rust toolchain
shell: bash
run: |
rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update
rustup default ${{ env.RUST_VERSION }}
- name: Install Rust toolchain
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install npm dependencies
run: |
# Install dependecies for generating docs
npm install
# Install dependecies for all the packages
for d in packages/*; do
echo "Building $d"
cd $d
npm install
npm run build
cd -
done
- name: Generate Spin JS SDK Docs
run: npm run docs
- name: Upload Spin JS SDK Docs as Artifact
id: docs_deployment
uses: actions/upload-pages-artifact@v5
with:
path: docs/
deploy_docs:
if: (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch')
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.docs_deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build_docs
steps:
- name: Deploy to GitHub Pages
id: docs_deployment
uses: actions/deploy-pages@v5