Skip to content

Commit 22af46c

Browse files
authored
Merge pull request #25 from loadnetwork/rebased-state
Rebased state
2 parents 4e3ce83 + a77144f commit 22af46c

276 files changed

Lines changed: 41083 additions & 5139 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
name: 🥘 Build & Deploy Docs HB
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
# Trigger on changes to docs, mkdocs config, or the workflow itself
9+
- "docs/**"
10+
- "mkdocs.yml"
11+
- ".github/workflows/build-deploy-docs.yml"
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
# Trigger on changes to docs, mkdocs config, or the workflow itself
17+
- "docs/**"
18+
- "mkdocs.yml"
19+
- ".github/workflows/build-deploy-docs.yml"
20+
21+
# Perform a release using a workflow dispatch
22+
workflow_dispatch:
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
# Run the build as part of PRs to confirm the site properly builds
30+
check_build:
31+
if: ${{ startsWith(github.ref, 'refs/pull/') }}
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- name: ⬇️ Checkout repo
35+
uses: actions/checkout@v3
36+
37+
# Setup Python environment
38+
- name: 🐍 Set up Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.x' # Use a recent Python 3 version
42+
43+
# Install Erlang OTP 27 using kerl
44+
- name: Install Erlang OTP 27
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
48+
git clone https://github.com/kerl/kerl.git
49+
./kerl/kerl build 27.0 otp-27.0
50+
./kerl/kerl install otp-27.0 ~/otp-27.0
51+
echo '. ~/otp-27.0/activate' >> ~/.bashrc
52+
. ~/otp-27.0/activate
53+
echo "Erlang version:"
54+
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
55+
# Install system dependencies needed for HyperBEAM
56+
- name: Install system dependencies
57+
run: |
58+
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
59+
build-essential \
60+
cmake \
61+
pkg-config \
62+
ncurses-dev \
63+
libssl-dev \
64+
ca-certificates
65+
# Debug step - display the region with syntax error
66+
- name: Debug syntax error region
67+
run: |
68+
echo "Showing the region with syntax error in hb_message.erl:"
69+
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
70+
echo "Checking for syntax error fix files:"
71+
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
72+
echo "Erlang version:"
73+
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
74+
# Install rebar3
75+
- name: Install rebar3
76+
run: |
77+
. ~/otp-27.0/activate
78+
mkdir -p ~/.config/rebar3
79+
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
80+
sudo mv rebar3 /usr/local/bin/rebar3
81+
. ~/otp-27.0/activate && rebar3 --version
82+
# Install Rust toolchain (needed for WASM components)
83+
- name: Install Rust and Cargo
84+
run: |
85+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
86+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
87+
source "$HOME/.cargo/env"
88+
# Setup Node.js
89+
- name: ⎔ Setup Node
90+
uses: actions/setup-node@v3
91+
with:
92+
node-version: 22 # Or your preferred version
93+
94+
# Install pip dependencies and cache them
95+
- name: 📦 Install Python dependencies
96+
run: |
97+
python -m pip install --upgrade pip
98+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
99+
- name: 🛠 Build Docs
100+
run: |
101+
. ~/otp-27.0/activate
102+
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
103+
# Build and deploy the artifacts to Arweave via ArDrive
104+
deploy:
105+
if: github.ref == 'refs/heads/main'
106+
runs-on: ubuntu-22.04
107+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
108+
# However, do NOT cancel in-progress runs as we want to allow these deployments to complete.
109+
concurrency:
110+
group: deploy
111+
cancel-in-progress: false
112+
steps:
113+
- name: ⬇️ Checkout repo
114+
uses: actions/checkout@v3
115+
116+
# Setup Python environment
117+
- name: 🐍 Set up Python
118+
uses: actions/setup-python@v5
119+
with:
120+
python-version: '3.x'
121+
122+
# Install Erlang OTP 27 using kerl
123+
- name: Install Erlang OTP 27
124+
run: |
125+
sudo apt-get update
126+
sudo apt-get install -y build-essential autoconf libncurses5-dev libssl-dev
127+
git clone https://github.com/kerl/kerl.git
128+
./kerl/kerl build 27.0 otp-27.0
129+
./kerl/kerl install otp-27.0 ~/otp-27.0
130+
echo '. ~/otp-27.0/activate' >> ~/.bashrc
131+
. ~/otp-27.0/activate
132+
echo "Erlang version:"
133+
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
134+
# Install system dependencies needed for HyperBEAM
135+
- name: Install system dependencies
136+
run: |
137+
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
138+
build-essential \
139+
cmake \
140+
pkg-config \
141+
ncurses-dev \
142+
libssl-dev \
143+
ca-certificates
144+
# Debug step - display the region with syntax error
145+
- name: Debug syntax error region
146+
run: |
147+
echo "Showing the region with syntax error in hb_message.erl:"
148+
sed -n '1440,1460p' src/hb_message.erl || echo "File not found or cannot be read"
149+
echo "Checking for syntax error fix files:"
150+
find . -name "*.erl.fix" -o -name "hb_message.erl.*" | grep -v ".beam" || echo "No fix files found"
151+
echo "Erlang version:"
152+
. ~/otp-27.0/activate && erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'
153+
# Install rebar3
154+
- name: Install rebar3
155+
run: |
156+
. ~/otp-27.0/activate
157+
mkdir -p ~/.config/rebar3
158+
curl -O https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
159+
sudo mv rebar3 /usr/local/bin/rebar3
160+
. ~/otp-27.0/activate && rebar3 --version
161+
# Install Rust toolchain (needed for WASM components)
162+
- name: Install Rust and Cargo
163+
run: |
164+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
165+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
166+
source "$HOME/.cargo/env"
167+
# Install pip dependencies and cache them
168+
- name: 📦 Install Python dependencies
169+
run: |
170+
python -m pip install --upgrade pip
171+
pip install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
172+
# Setup Node.js (needed for npx deploy command)
173+
- name: ⎔ Setup Node
174+
uses: actions/setup-node@v3
175+
with:
176+
node-version: 22 # Or your preferred version
177+
178+
- name: 👀 Env
179+
run: |
180+
echo "Event name: ${{ github.event_name }}"
181+
echo "Git ref: ${{ github.ref }}"
182+
echo "GH actor: ${{ github.actor }}"
183+
echo "SHA: ${{ github.sha }}"
184+
VER=`node --version`; echo "Node ver: $VER"
185+
VER=`npm --version`; echo "npm ver: $VER"
186+
. ~/otp-27.0/activate && erl -eval 'io:format("Erlang OTP version: ~s~n", [erlang:system_info(otp_release)]), halt().'
187+
- name: 🛠 Build Docs
188+
id: build_artifacts
189+
run: |
190+
. ~/otp-27.0/activate
191+
SKIP_COMPILE=1 SKIP_EDOC=1 ./docs/build-all.sh -v
192+
touch mkdocs-site/.nojekyll
193+
echo "artifacts_output_dir=mkdocs-site" >> $GITHUB_OUTPUT
194+
- name: 💾 Publish to Arweave
195+
id: publish_artifacts
196+
run: |
197+
npx permaweb-deploy \
198+
--arns-name=dps-testing-facility \
199+
--ant-process=${{ secrets.ANT_PROCESS }} \
200+
--deploy-folder=${ARTIFACTS_OUTPUT_DIR}
201+
env:
202+
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
203+
ARTIFACTS_OUTPUT_DIR: ${{ steps.build_artifacts.outputs.artifacts_output_dir }}
204+
ANT_PROCESS: ${{ secrets.ANT_PROCESS }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ logs
1919
*.iml
2020
rebar3.crashdump
2121
*~
22+
/venv
2223

2324
*.json
2425
!.vscode/*
@@ -40,4 +41,7 @@ cache-*
4041

4142
cu/
4243
mkdocs-site/
43-
deployment.sh
44+
mkdocs-site-id.txt
45+
mkdocs-site-manifest.csv
46+
!test/admissible-report-wallet.json
47+
deployment.sh

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"editor.detectIndentation": false,
3-
"editor.insertSpaces": false,
3+
"editor.insertSpaces": true,
44
"editor.tabSize": 4
55
}

README.md

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ To start a shell with profiles:
9999
rebar3 as rocksdb shell
100100

101101
# Multiple profiles
102-
rebar3 as rocksdb,genesis_wasm shell
102+
rebar3 as rocksdb, genesis_wasm shell
103103
```
104104

105105
To create a release with profiles:
@@ -266,42 +266,36 @@ schedule of another execution.
266266
Details on other devices found in the pre-loaded set can be located in their
267267
respective documentation.
268268

269-
## Contributing
269+
## Documentation
270270

271-
HyperBEAM is developed as an open source implementation of the AO-Core protocol
272-
by [Forward Research](https://fwd.arweave.net). Pull Requests are always welcome!
271+
HyperBEAM uses [MkDocs](https://www.mkdocs.org/) with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme to build its documentation site. All documentation source files are located in the `docs/` directory.
273272

274-
To get started building on HyperBEAM, check out the [hacking on HyperBEAM](./docs/contribute/setup.md)
275-
guide.
273+
To build and view the documentation locally:
276274

277-
## Documentation
275+
```bash
276+
# Create and activate a virtual environment (optional but recommended)
277+
python3 -m venv venv
278+
source venv/bin/activate # (macOS/Linux) On Windows use `venv\Scripts\activate`
278279

279-
HyperBEAM uses [MkDocs](https://www.mkdocs.org/) with the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) theme to build its documentation site.
280+
# Install required packages
281+
pip3 install mkdocs mkdocs-material mkdocs-git-revision-date-localized-plugin
280282

281-
Building the documentation requires Python 3, pip, and the following packages:
282-
```bash
283-
pip3 install mkdocs mkdocs-material
284-
```
283+
# Build the docs
284+
./docs/build-all.sh
285285

286-
- **Source Files:** All documentation source files (Markdown `.md`, images, CSS) are located in the `docs/` directory.
287-
- **Source Code Docs:** Erlang source code documentation is generated using `rebar3 edoc` (with the `edown_doclet` plugin) into the `docs/source-code-docs/` directory as Markdown files. These are then incorporated into the main MkDocs site.
288-
- **Build Script:** The entire process (compiling, generating edoc, processing source docs, building the site) is handled by the `./docs/build-all.sh` script.
286+
# Serve the docs
287+
cd mkdocs-site
288+
python3 -m http.server 8000
289+
# Then open http://127.0.0.1:8000/ in your browser
290+
```
289291

290-
To build and view the documentation locally:
292+
For more details on the documentation structure, how to contribute, and other information, please see the [full documentation README](./docs/README.md).
291293

292-
1. Ensure you are in the project root directory.
293-
2. Run the build script:
294-
```bash
295-
./docs/build-all.sh
296-
```
294+
## Contributing
297295

298-
This script performs the following steps:
299-
- Compiles the Erlang project (`rebar3 compile`).
300-
- Generates Markdown documentation from source code comments (`rebar3 edoc`) into `docs/source-code-docs/`.
301-
- Processes the generated source code Markdown files (updates index, cleans up TOCs).
302-
- Builds the MkDocs site into the `dist/mkdocs` directory (`mkdocs build`).
303-
- Starts a local development server (`mkdocs serve`) to view the site at `http://127.0.0.1:8000/`.
296+
HyperBEAM is developed as an open source implementation of the AO-Core protocol
297+
by [Forward Research](https://fwd.arweave.net). Pull Requests are always welcome!
304298

305-
Press `Ctrl+C` in the terminal where the script is running to stop the local server.
299+
To get started building on HyperBEAM, check out the [hacking on HyperBEAM](./docs/misc/hacking-on-hyperbeam.md)
300+
guide.
306301

307-
The final static site is generated in the `dist/mkdocs` directory, as configured in `mkdocs.yml` (`site_dir: dist/mkdocs`).

config.flat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
port: 10001
1+
port: 10001

0 commit comments

Comments
 (0)