Skip to content

Commit 229b4b8

Browse files
Station plugin (#250)
* Add plugin .gitignore to exclude build artifacts and log files * Add PluginAPI to int/api with plugin registration and station middleware Will later be used to also to put a plugin specific front end page * Add initial plugin implementation * Add plugin manifest file and favicon * Add Taskfile for plugin * Add README.md for DeWeb Station Plugin with setup and installation instructions * Add basic plugin frontend * Add homePage serving from plugin * Remove useless commands for moving zip files in Taskfile.yml * Add GitHub Actions workflow to build and upload plugin artifacts for multiple OS targets * Add working-directory input to GitHub Actions install action and update workflows to utilize it * Improve plugin favicon * Add default route handling * Remove unnecessary blank line in configurePluginAPI function * Update GitHub Actions workflow to include additional plugin files in artifact upload * Update ubuntu to 22.04 in build workflow * Fix artifact naming and path in GitHub Actions build workflow * Add network info fetching and enhance UI in App component * Remove useless public/ from favicon path in home index.html * Set mainnet as default for deweb plugin * Fix artifact naming convention in GitHub Actions build workflow * Add config file handling for DeWeb plugin * Apply review suggestions * Add missing font * Apply UI/UX review suggestions * Update DeWeb plugin home page README.md * Refacto workflows (#261) * Disable old workflows * Divide build and release workflow into a server and a plugin workflow * Add missing task generate * Add CLI workflow * Update plugin release workflow to use new artifact path for zip files * Add job needs in plugin release workflows * Remove obsolete GitHub workflows for build, linting, and testing * Apply CR comments * Update plugin go.mod * Update golangci-lint version to v1.64 in GitHub workflows * Move cache init at API init * Update plugin config structure to use CacheConfig object * Fix misnamed variables in config * Add example configuration file for DeWeb plugin * audit fix server pages and plugin home * Fix plugin build * Update plugin/config.yaml.example Co-authored-by: Andrei <34773578+fleandrei@users.noreply.github.com> * Fix PluginDir not returning errors during stat if not IsNotExist * Remove duplicated cacheKeyType and cacheKey constants from API definition * Add command-line flags for configuration and log file paths; enhance cache path resolution in config processing * Add network information to DeWebInfo endpoint * Add Plugin API spec and generated files * Update plugin frontend to show server status and build output to plugin api dir * Add plugin API implem and configuration management * Remove now useless old plugin config code and example file * Add build-server task and update file copy commands to add the server binary to the archive * Add mkdir command to create build directory in Taskfile.yml * Refactor workflows for building and releasing server and plugin * Fix wrong path for downloaded artifacts in plugin workflow * Use Ubuntu to build windows * Update server command to include --accept-disclaimer flag * Remove deprecated PluginAPI implementation from the server API package. * Remove useless helloworld plugin from server go mod * Add private kill function and improve error handling at start in server manager * Update plugin manifest to reflect new name and description, and change version to 0.4.4 * Update favicon and manifest description, and adjust environment paths for local DeWeb provider * Update title in index.html to and update favicon for plugin frontend * Add AWS S3 upload step and configure AWS credentials in release workflow --------- Co-authored-by: Andrei <34773578+fleandrei@users.noreply.github.com>
1 parent 6d0d9ac commit 229b4b8

File tree

87 files changed

+11005
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+11005
-232
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,29 @@
1-
name: build and upload artifacts
1+
name: Build Server and Plugin
22

33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'plugin/**'
8+
- 'server/**'
9+
- '.github/workflows/**'
10+
- '.github/actions/**'
611
pull_request:
12+
paths:
13+
- 'plugin/**'
14+
- 'server/**'
15+
- '.github/workflows/**'
16+
- '.github/actions/**'
717
workflow_dispatch:
8-
workflow_call:
9-
inputs:
10-
tag_name:
11-
type: string
12-
description: "The tag name of the release without v prefix"
13-
14-
env:
15-
VERSION: ${{ inputs.tag_name }}
1618

1719
jobs:
18-
build:
19-
name: build and upload artifacts
20-
strategy:
21-
matrix:
22-
include:
23-
- os: windows-2022
24-
arch: amd64
25-
target: windows
26-
ext: .exe
27-
- os: ubuntu-22.04
28-
arch: amd64
29-
target: linux
30-
- os: ubuntu-22.04
31-
arch: arm64
32-
target: linux
33-
- os: macos-13
34-
arch: amd64
35-
target: darwin
36-
- os: macos-14
37-
arch: arm64
38-
target: darwin
39-
40-
runs-on: ${{ matrix.os }}
41-
42-
defaults:
43-
run:
44-
working-directory: ./server
45-
46-
steps:
47-
- name: Checkout repository
48-
uses: actions/checkout@v4
49-
50-
- name: installing dependencies
51-
uses: ./.github/actions/install
52-
with:
53-
os: ${{ matrix.os }}
54-
repo-token: ${{ secrets.GITHUB_TOKEN }}
55-
56-
- name: Check if VERSION exists
57-
shell: bash
58-
id: check_version
59-
run: |
60-
if [ ! -z "${{ env.VERSION }}" ]; then
61-
echo "PRODUCTION=true" >> $GITHUB_ENV
62-
fi
63-
64-
- name: Build Server
65-
shell: bash
66-
run: task build
67-
env:
68-
OS: ${{ matrix.target }}
69-
ARCH: ${{ matrix.arch }}
70-
71-
- name: Rename Server artifact
72-
run: mv build/deweb-server${{ matrix.ext }} build/deweb-server_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}
73-
74-
- name: Upload Server artifact
75-
uses: actions/upload-artifact@v4
76-
with:
77-
name: deweb-server_${{ matrix.target }}_${{ matrix.arch }}
78-
path: server/build/deweb-server_${{ matrix.target }}_${{ matrix.arch }}${{ matrix.ext }}
20+
build-server:
21+
name: Build server
22+
uses: ./.github/workflows/server.yml
23+
secrets: inherit
24+
25+
build-plugin:
26+
name: Build plugin
27+
needs: build-server
28+
uses: ./.github/workflows/plugin.yml
29+
secrets: inherit
Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
1-
name: tests
1+
name: CLI
22

33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- 'cli/**'
8+
- '.github/workflows/cli.yml'
69
pull_request:
7-
workflow_call:
10+
paths:
11+
- 'cli/**'
12+
- '.github/workflows/cli.yml'
13+
workflow_dispatch:
814

915
jobs:
10-
test-server:
11-
runs-on: ubuntu-22.04
12-
16+
lint:
17+
runs-on: ubuntu-latest
1318
defaults:
1419
run:
15-
working-directory: ./server
16-
20+
working-directory: ./cli
1721
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v4
20-
21-
- name: installing dependencies
22-
uses: ./.github/actions/install
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
2324
with:
24-
repo-token: ${{ secrets.GITHUB_TOKEN }}
25-
26-
- name: Run unit tests
27-
run: go test ./...
25+
node-version: 20
26+
cache: "npm"
27+
cache-dependency-path: ./cli/package-lock.json
28+
- name: Install dependencies
29+
run: npm ci
30+
- name: Run code formatting and linting
31+
run: npm run fmt:check
2832

29-
test-cli:
33+
test:
3034
runs-on: ubuntu-22.04
31-
3235
defaults:
3336
run:
3437
working-directory: ./cli
35-
3638
steps:
3739
- name: Checkout repository
3840
uses: actions/checkout@v4
3941
- uses: actions/setup-node@v4
4042
with:
4143
node-version: 20
4244
cache: "npm"
43-
cache-dependency-path: ./server/pages/package-lock.json
45+
cache-dependency-path: ./cli/package-lock.json
4446
- name: Install dependencies
4547
run: npm ci
4648
- name: Run unit tests
4749
run: npm test
4850

49-
functional-test-cli:
51+
functional-test:
5052
runs-on: ubuntu-22.04
51-
5253
defaults:
5354
run:
5455
working-directory: ./cli
55-
5656
steps:
5757
- name: Checkout repository
5858
uses: actions/checkout@v4
5959
- uses: actions/setup-node@v4
6060
with:
6161
node-version: 20
6262
cache: "npm"
63-
cache-dependency-path: ./server/pages/package-lock.json
63+
cache-dependency-path: ./cli/package-lock.json
6464
- name: Install dependencies
6565
run: npm ci
6666
- name: Setup wallet
@@ -76,4 +76,4 @@ jobs:
7676
npm run build
7777
npm run start -- upload -y --wallet ./wallet_fullpower.yaml --password $WALLET_TEST_PASSWORD ../smart-contract/src/e2e/test-project/dist
7878
env:
79-
WALLET_TEST_PASSWORD: ${{ secrets.WALLET_TEST_PASSWORD }}
79+
WALLET_TEST_PASSWORD: ${{ secrets.WALLET_TEST_PASSWORD }}

.github/workflows/lint.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)