Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
50 changes: 25 additions & 25 deletions .github/workflows/tests.yml → .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
name: tests
name: CLI

on:
push:
branches: [main]
paths:
- 'cli/**'
- '.github/workflows/cli.yml'
pull_request:
workflow_call:
paths:
- 'cli/**'
- '.github/workflows/cli.yml'
workflow_dispatch:

jobs:
test-server:
runs-on: ubuntu-22.04

lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server

working-directory: ./cli
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: installing dependencies
uses: ./.github/actions/install
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run unit tests
run: go test ./...
node-version: 20
cache: "npm"
cache-dependency-path: ./cli/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run code formatting and linting
run: npm run fmt:check

test-cli:
test:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./cli

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./server/pages/package-lock.json
cache-dependency-path: ./cli/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test

functional-test-cli:
functional-test:
runs-on: ubuntu-22.04

defaults:
run:
working-directory: ./cli

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: ./server/pages/package-lock.json
cache-dependency-path: ./cli/package-lock.json
- name: Install dependencies
run: npm ci
- name: Setup wallet
Expand All @@ -76,4 +76,4 @@ jobs:
npm run build
npm run start -- upload -y --wallet ./wallet_fullpower.yaml --password $WALLET_TEST_PASSWORD ../smart-contract/src/e2e/test-project/dist
env:
WALLET_TEST_PASSWORD: ${{ secrets.WALLET_TEST_PASSWORD }}
WALLET_TEST_PASSWORD: ${{ secrets.WALLET_TEST_PASSWORD }}
76 changes: 0 additions & 76 deletions .github/workflows/lint.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/plugin-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Plugin Release

on:
workflow_dispatch:
inputs:
version:
description: 'Plugin version for this release (without v prefix)'
required: true
type: string
release-as-draft:
description: "Whether it's a draft or not"
required: true
type: boolean
default: true
release-as-prerelease:
description: "Whether it's a prerelease or not"
required: true
type: boolean
default: false
generate-release-notes:
description: "Generate release notes"
required: true
type: boolean
default: true

jobs:
check-manifest:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check the manifest version
working-directory: ./plugin
run: |
sudo apt-get install -y jq
version=$(jq -r '.version' manifest.json)
input_version=${{ inputs.version }}
if [[ "$version" != "$input_version" ]]; then
echo "ERROR: The manifest version ($version) does not match the input version ($input_version)"
exit 1
fi
echo "Manifest version matches input version: $version"

extract-version:
runs-on: ubuntu-latest
needs: check-manifest
outputs:
version: ${{ inputs.version }}
steps:
- name: Set version
id: get-version
run: |
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "Plugin Version: ${{ inputs.version }}"

build-plugin:
uses: ./.github/workflows/plugin.yml
needs: check-manifest
with:
version: ${{ inputs.version }}
secrets: inherit

create-release:
needs: [check-manifest, extract-version, build-plugin]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: 'deweb-plugin_*'

- name: List artifacts
run: ls -R artifacts

- name: Create zip packages for each platform
run: |
mkdir -p release_zips

# Find all artifact folders
for platform_dir in artifacts/deweb-plugin_*; do
# Extract the platform name from the directory
platform_name=$(basename "$platform_dir")

# Create a zip package for this platform
(cd "$platform_dir" && zip -r "../../release_zips/${platform_name}.zip" *)

echo "Created zip package for $platform_name"
done

ls -la release_zips/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: plugin-v${{ needs.extract-version.outputs.version }}
name: plugin v${{ needs.extract-version.outputs.version }}
draft: ${{ inputs.release-as-draft }}
prerelease: ${{ inputs.release-as-prerelease }}
generate_release_notes: ${{ inputs.generate-release-notes }}
files: |
release_zips/*.zip
Loading