-
Notifications
You must be signed in to change notification settings - Fork 1
119 lines (99 loc) · 3.07 KB
/
build-and-release.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
name: Build, Release, Deploy
on:
workflow_dispatch:
release:
types: [created] # Trigger when a new release is created
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build_release:
name: Build release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Binstall
uses: cargo-bins/cargo-binstall@main
- name: Set up Rust
uses: dtolnay/rust-toolchain@nightly
with:
targets: wasm32-unknown-unknown, wasm32-wasi
toolchain: nightly-x86_64-unknown-linux-gnu
components: rust-src, rustfmt
- name: Install cargo component
run: echo yes | cargo binstall cargo-component@0.10.1
- name: Run binstall just, wasm-tools
run: |
# Run binstall just with the --no-confirm flag
cargo binstall just --no-confirm
cargo install wasm-tools
- name: Build and Compose Wasm
run: |
just build-submodules
just compose
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: wasm-artifact
path: dist/peerpiper_wallet_aggregate.wasm
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: dist/peerpiper_wallet_aggregate.wasm
tag_name: prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set VITE_BASE
run: |
echo "VITE_BASE=https://${GITHUB_REPOSITORY_OWNER,,}.github.io/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Set BASE_PATH
run: |
echo "BASE_PATH=/${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: npm
cache-dependency-path: "./packages/integrity-wallet/package-lock.json"
- name: Install dependencies
run: |
cd packages/integrity-wallet
npm install
cd inner-app
npm install
- name: build
env:
BASE_PATH: ${{ env.BASE_PATH }}
VITE_BASE: ${{ env.VITE_BASE }}
run: |
cd packages/integrity-wallet/inner-app
npm run build
cd ..
npm run build
# touch docs/.nojekyll
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v4
with:
# this should match the `pages` option in your adapter-static options
path: "packages/integrity-wallet/docs/"
deploy:
needs: build_release
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v3
- name: Deploy
id: deployment
uses: actions/deploy-pages@v2