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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ jobs:
VERSION: ${{ inputs.tag_name }}

- name: Sign Macos binary
uses: massalabs/massa/.github/actions/sign-macos@ccc3f02e34544f722634a6fb7732cc4bb515e90b
uses: massalabs/massa/.github/actions/sign-macos@a7f27829f755d30fc9f29f6c0425536cc96be4c4
if: ${{ runner.os == 'macOS' }}
with:
paths: "build/node-manager-plugin"
certificate-p12-base64: ${{ secrets.APPLE_CERTIFICATE_P12_BASE64 }}
certificate-password: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}
signing-identity: ${{ vars.APPLE_DEVELOPER_ID_APPLICATION }}
entitlements: "entitlements.plist"

- name: Rename Plugin artifact
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Download plugin binary artifacts
uses: actions/download-artifact@v4
with:
pattern: 'node-manager-plugin_${{matrix.target}}*'
pattern: ${{ env.TARGET_NAME }}

- name: make bin executable
run: |
Expand Down
22 changes: 17 additions & 5 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,33 @@ vars:

tasks:
install:
desc: Install development dependencies (swagger, mockery, gofumpt, golangci-lint)
cmds:
- cmd: go install github.com/go-swagger/go-swagger/cmd/swagger@latest
- cmd: go install github.com/vektra/mockery/v3@v3.5.0
- cmd: go install mvdan.cc/gofumpt@v0.8.0
- cmd: go install github.com/daixiang0/gci@v0.13.4
- cmd: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.3.0
- cmd: echo "PATH=$PATH"
- cmd: echo "GOPATH=$GOPATH"

generate:
desc: Generate code and mocks
cmds:
- cmd: go generate -x -v ./...
- cmd: echo "PATH=$PATH"
- cmd: echo "GOPATH=$GOPATH"
- task: generate-mocks
- task: setup-node-folder

generate-mocks:
desc: Generate mock files using mockery
cmds:
- cmd: mockery

generate-test-data:
desc: Generate test data for database tests
cmds:
- cmd: go run int/db/test_data/generate_test_data.go

setup-node-folder:
desc: Setup node binaries for different platforms (mainnet and buildnet)
cmds:
- cmd: scripts/setup-node-unix.sh {{.MAINNET_VERSION}} {{.BUILDNET_VERSION}} {{.MAINNET_NODEBIN}} {{.BUILDNET_NODEBIN}} {{.NODE_MASSA_DIR}}
platforms: [linux, darwin]
Expand Down Expand Up @@ -78,6 +80,7 @@ tasks:
# This task is used to setup windows node binaries in linux environment.
# It is used in github action workflow ci
ci-setup-windows-node-with-unix:
desc: Setup Windows node binaries in Linux CI environment
platforms: [linux]
cmds:
- cmd: scripts/ci-setup-node-from-linux.sh {{.MAINNET_VERSION}} {{.BUILDNET_VERSION}} {{.NODE_MASSA_DIR}}
Expand All @@ -86,14 +89,14 @@ tasks:
BUILDNET_NODEBIN: "massa_{{.BUILDNET_VERSION}}_release_windows.zip"

run:
desc: Run the built application in standalone mode
cmds:
- cmd: ./build/node-manager-plugin
env:
STANDALONE: 1
LOG_LEVEL: DEBUG

build-backend:
build:
desc: Internal build task
cmds:
- cmd: 'echo Building node-manager {{.APP_NAME}} for $GOOS/$GOARCH'
Expand All @@ -103,6 +106,7 @@ tasks:
- cmd: 'echo Version: {{.VERSION | default "Development"}}'
silent: true
- cmd: go build {{.BUILD_FLAGS}} -o {{.BIN_DIR}}/{{.APP_NAME}}{{.BIN_EXT}} ./main.go

vars:
PRODUCTION: '{{if ne .VERSION nil}}{{if ne .VERSION ""}}true{{end}}{{end}}'
VERSION_FLAG: '{{if ne .VERSION nil}}{{if ne .VERSION ""}}-X github.com/massalabs/node-manager-plugin/int/config.Version={{.VERSION}}{{end}}{{end}}'
Expand All @@ -114,19 +118,22 @@ tasks:
VERSION: "{{.VERSION | default nil}}"

build-frontend:
desc: Build the web frontend
dir: web
cmds:
- cmd: npm run build{{.BUILD_MODE}}
vars:
BUILD_MODE: '{{if eq .STANDALONE 1}}:standalone{{end}}'

build:
desc: Build both frontend and backend
cmds:
- task: build-frontend
- task: build-backend


build-standalone:
desc: Build in standalone mode (frontend and backend)
cmds:
- task: build-frontend
vars:
Expand All @@ -135,10 +142,12 @@ tasks:


clean:
desc: Clean build artifacts, node_modules and generated files
cmds:
- cmd: rm -rf build && rm -rf web/node_modules && rm -rf int/api/html/dist

install-plugin:
desc: Install the plugin to MassaStation (platform-specific paths)
cmds:
- cmd: mkdir -p /usr/local/share/massastation/plugins/node-manager-plugin
platforms: [linux, darwin]
Expand All @@ -163,14 +172,17 @@ tasks:
platforms: [windows]

test:
desc: Run Go tests for all packages
cmds:
- cmd: go test ./...

lint:
desc: Run golangci-lint for code quality checks
cmds:
- cmd: golangci-lint run

fmt:
desc: Format code (go mod tidy, gofumpt, gci, lint --fix, npm fmt)
cmds:
- cmd: go mod tidy
- cmd: gofumpt -l -w .
Expand Down
9 changes: 9 additions & 0 deletions entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- CRITICAL: Required by memguard library for secure memory operations -->
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
Loading