Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 31 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
matrix:
rust:
- stable
- beta
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -40,7 +39,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@stable
- name: Build the workspace with the features
Expand All @@ -59,7 +58,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -71,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install doxygen 1.9.5
Expand All @@ -96,9 +95,9 @@ jobs:
cp -a ffi/bindings/java/rodbus/target/apidocs ~/doc/java
rm ffi/bindings/c/generated/logo.png ffi/bindings/c/generated/doxygen-awesome.css
- name: Upload documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: doc
name: doc-api
path: ~/doc
# Build bindings on Windows x64 [64-bit MSVC (Windows 7+) (x86_64-pc-windows-msvc)] and x86 [32-bit MSVC (Windows 7+) (i686-pc-windows-msvc)]
bindings-windows:
Expand All @@ -113,7 +112,7 @@ jobs:
test: false
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Create the FFI modules dir
Expand All @@ -129,9 +128,9 @@ jobs:
Copy-Item -Path ./target/${{ matrix.target }}/release/rodbus_ffi.dll.lib -Destination ffi-modules/${{ matrix.target }}
Copy-Item -Path ./target/${{ matrix.target }}/release/rodbus_ffi_java.dll -Destination ffi-modules/${{ matrix.target }}
- name: Upload compiled FFI modules
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ffi-modules
name: ffi-modules-${{ matrix.target }}
path: ffi-modules
- name: C Bindings Tests
if: ${{ matrix.test }}
Expand All @@ -155,7 +154,7 @@ jobs:
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Create FFI modules dir
Expand All @@ -169,9 +168,9 @@ jobs:
cp ./target/release/librodbus_ffi.dylib ./ffi-modules/${{ matrix.target }}
cp ./target/release/librodbus_ffi_java.dylib ./ffi-modules/${{ matrix.target }}
- name: Upload compiled FFI modules
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ffi-modules
name: ffi-modules-${{ matrix.target }}
path: ffi-modules
- name: Test .NET bindings
run: cargo run --bin rodbus-bindings -- --dotnet
Expand Down Expand Up @@ -199,7 +198,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Rust Cross
Expand All @@ -215,28 +214,28 @@ jobs:
cp ./target/${{ matrix.target }}/release/librodbus_ffi.so ./ffi-modules/${{ matrix.target }}
cp ./target/${{ matrix.target }}/release/librodbus_ffi_java.so ./ffi-modules/${{ matrix.target }}
- name: Upload compiled FFI modules
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ffi-modules
name: ffi-modules-${{ matrix.target }}
path: ffi-modules
guide:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install dependencies
working-directory: guide
run: yarn install
run: npm install
- name: Build guide
working-directory: guide
run: |
yarn build
npm run build
mkdir -p ~/doc/guide
mv build/* ~/doc/guide
- name: Upload guide
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: doc
name: doc-guide
path: ~/doc
# Package all the generated bindings
packaging:
Expand All @@ -252,10 +251,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Download compiled FFI
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ffi-modules
pattern: ffi-modules-*
path: ffi-modules
merge-multiple: true
- name: Create SBOMs
run: |
for dir in ffi-modules/*; do
Expand All @@ -276,32 +276,29 @@ jobs:
- name: Package Java bindings
run: cargo run --bin rodbus-bindings -- --java --package ./ffi-modules --options ./packaging.json -f third-party-licenses-java.txt
- name: Upload C/C++ bindings
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: c-bindings
path: ffi/bindings/c/generated/*
- name: Upload .NET bindings
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dotnet-bindings
path: ffi/bindings/dotnet/nupkg/*
- name: Upload Java bindings
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: java-bindings
path: ffi/bindings/java/rodbus/target/*.jar
- name: Upload Java pom.xml
uses: actions/upload-artifact@v3
with:
name: java-bindings
path: ffi/bindings/java/rodbus/pom.xml
path: |
ffi/bindings/java/rodbus/target/*.jar
ffi/bindings/java/rodbus/pom.xml
release:
needs: [packaging, guide]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Package C Bindings
Expand All @@ -310,7 +307,7 @@ jobs:
cd artifacts/c-bindings
zip -r ../../release/rodbus-${GITHUB_REF##*/}.zip .
- name: Checkout stepfunc/docs
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: stepfunc/docs
ssh-key: ${{ secrets.SFIO_DOCS_SSH_KEY }}
Expand Down
34 changes: 34 additions & 0 deletions allowed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"build_only": [
"addr2line",
"adler",
"adler2",
"anstream",
"anstyle",
"anstyle-parse",
Expand All @@ -11,6 +12,7 @@
"autocfg",
"backtrace",
"cc",
"cfg_aliases",
"clap",
"clap_builder",
"clap_derive",
Expand All @@ -27,6 +29,7 @@
"linux-raw-sys",
"object",
"oo-bindgen",
"once_cell_polyfill",
"os_str_bytes",
"pathdiff",
"pest",
Expand All @@ -40,6 +43,7 @@
"semver",
"semver-parser",
"serde_derive",
"shlex",
"strsim",
"termcolor",
"ucd-trie",
Expand Down Expand Up @@ -336,6 +340,21 @@
}
]
},
"core-foundation": {
"id": "core-foundation",
"source": "crates.io",
"licenses": [
{
"MIT": {
"copyright": {
"Lines": [
"Copyright (c) 2012-2013 Mozilla Foundation"
]
}
}
}
]
},
"CoreFoundation-sys": {
"id": "CoreFoundation-sys",
"source": "crates.io",
Expand Down Expand Up @@ -1799,6 +1818,21 @@
}
]
},
"windows-link": {
"id": "windows-link",
"source": "crates.io",
"licenses": [
{
"MIT": {
"copyright": {
"Lines": [
"Copyright (c) Microsoft Corporation"
]
}
}
}
]
},
"windows-sys": {
"id": "windows-sys",
"source": "crates.io",
Expand Down
49 changes: 35 additions & 14 deletions guide/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# Website
# Rodbus Documentation Website

This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.

## Installation
## Ubuntu Setup

Install Node.js and npm:

```bash
# Update package index
sudo apt update

# Install Node.js v20 (recommended) or v18.19+ (minimum)
# For Node.js v20 (recommended):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# For Node.js v18 (if v20 is not available):
# curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
# sudo apt install -y nodejs

# Verify installation
node --version
npm --version

```console
yarn install
```

## Local Development
## Installation

Install the project dependencies:

```console
yarn start
npm install
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
## Local Development

## Build
Start the development server:

```console
yarn build
npm run start
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
This command starts a local development server and opens a browser window. Most changes are reflected live without having to restart the server.

## Build

## Deployment
Generate static content:

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
npm run build
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
This command generates static content into the `build` directory and can be served using any static contents hosting service.
11 changes: 8 additions & 3 deletions guide/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const path = require('path');
const samplePlugin = require('./plugins/sample');
const mermaidPlugin = require('./plugins/mermaid');
const sitedata = require('./sitedata.json');

const {themes} = require('prism-react-renderer');
const vsLight = themes.vsLight;

module.exports = {
title: `Rodbus ${sitedata.version}`,
tagline: 'Pretty sure we don\'t need this page, just the docs',
Expand All @@ -15,7 +17,7 @@ module.exports = {
projectName: 'rodbus', // Usually your repo name.
themeConfig: {
prism: {
theme: require('prism-react-renderer/themes/vsLight'),
theme: vsLight,
additionalLanguages: ['rust', 'java', 'csharp', 'cmake'],
},
colorMode: {
Expand Down Expand Up @@ -84,7 +86,6 @@ module.exports = {
sidebarPath: require.resolve('./sidebars.js'),
remarkPlugins: [
samplePlugin,
mermaidPlugin,
],
},
theme: {
Expand All @@ -94,4 +95,8 @@ module.exports = {
],
],
plugins: [path.resolve(__dirname, './plugins/changelog')],
themes: ['@docusaurus/theme-mermaid'],
markdown: {
mermaid: true,
},
};
Loading