Skip to content

Commit

Permalink
Merge pull request #154 from ubiquity-os-marketplace/development
Browse files Browse the repository at this point in the history
Merge development into main
  • Loading branch information
gentlementlegen authored Oct 10, 2024
2 parents 66197a3 + 321a62c commit adde9f8
Show file tree
Hide file tree
Showing 90 changed files with 6,388 additions and 5,251 deletions.
25 changes: 22 additions & 3 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/tests/**"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "**/tests/**", "dist/**"],
"useGitignore": true,
"language": "en",
"words": ["dataurl", "devpool", "outdir", "servedir", "ubiquibot", "tiktoken", "typebox", "supabase", "wxdai", "noopener", "knip", "hellip", "mswjs"],
"words": [
"dataurl",
"devpool",
"outdir",
"servedir",
"ubiquibot",
"tiktoken",
"typebox",
"supabase",
"wxdai",
"noopener",
"knip",
"hellip",
"mswjs",
"Rpcs"
],
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
"import": [
"@cspell/dict-typescript/cspell-ext.json",
"@cspell/dict-node/cspell-ext.json",
"@cspell/dict-software-terms"
],
"ignoreRegExpList": ["[0-9a-fA-F]{6}"]
}
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GITHUB_TOKEN="<token>"
OPENAI_API_KEY="<api_key>"
# treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1%
PERMIT_FEE_RATE=""
# github account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquibot-treasury"
# github account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquity-os-treasury"
PERMIT_TREASURY_GITHUB_USERNAME=""
# comma separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6"
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST=""
53 changes: 0 additions & 53 deletions .eslintrc

This file was deleted.

36 changes: 4 additions & 32 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,9 @@ jobs:
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST: ${{ secrets.PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST }}

steps:
- name: Post starting comment to issue
uses: actions/github-script@v7
id: post-comment
with:
github-token: ${{ inputs.authToken }}
script: |
const comment_body = '\`\`\`diff\n+ Evaluating results. Please wait...';
const obj = ${{ inputs.eventPayload }}
if (obj.issue && "${{ inputs.eventName }}" === "issues.closed" && obj.issue.state_reason === "completed") {
const response = await github.rest.issues.createComment({
owner: obj.repository.owner.login,
repo: obj.repository.name,
issue_number: obj.issue.number,
body: comment_body,
});
core.setOutput('comment_id', response.data.id);
}
- name: Set environment variable
run: echo "COMMENT_ID=${{ steps.post-comment.outputs.comment_id }}" >> $GITHUB_ENV

- run: ${{ toJSON(inputs) }}
shell: cat {0}

- name: Checkout code
# Note: the checkout could potentially be avoided by calling the workflow on the repo/branch directly.
# However, this would mean that we would be unable to call it from the branch specified in ubiquity-os-config
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Generate Rewards
- name: Run compute rewards
uses: ./
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Spell Check
name: Formatting Checks

on:
push:
pull_request:

jobs:
spellcheck:
name: Check for spelling errors
name: Check for formatting errors
runs-on: ubuntu-latest

steps:
Expand All @@ -18,8 +18,9 @@ jobs:
with:
node-version: "20.10.0"

- name: Install cspell
run: yarn add cspell

- name: Run cspell
run: yarn format:cspell
- name: Run formatting checks
run: |
yarn install
yarn eslint --fix-dry-run --ignore-pattern dist/
yarn format:cspell
yarn prettier --check .
2 changes: 1 addition & 1 deletion .github/workflows/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
name: knip-results
path: |
knip-results.json
pr-number.txt
pr-number.txt
50 changes: 4 additions & 46 deletions .github/workflows/update-configuration.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,16 @@
name: "Update Configuration"
name: "Update Configuration and Build"

on:
workflow_dispatch:
push:

jobs:
update:
name: "Update Configuration in manifest.json"
name: "Update Configuration & Build"
runs-on: ubuntu-latest
permissions: write-all

steps:
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20.10.0"

- name: Install deps and run configuration update
run: |
yarn install --immutable --immutable-cache --check-cache
yarn tsc --noCheck --project tsconfig.json
- name: Update manifest configuration using GitHub Script
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const { pluginSettingsSchema } = require('./src/types/plugin-inputs');
const manifestPath = path.resolve("${{ github.workspace }}", './manifest.json');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
const configuration = JSON.stringify(pluginSettingsSchema);
manifest["configuration"] = JSON.parse(configuration);
const updatedManifest = JSON.stringify(manifest, null, 2)
console.log('Updated manifest:', updatedManifest);
fs.writeFileSync(manifestPath, updatedManifest);
- name: Commit and Push generated types
run: |
git config --global user.name 'ubiquity-os[bot]'
git config --global user.email 'ubiquity-os[bot]@users.noreply.github.com'
git add ./manifest.json
if [ -n "$(git diff-index --cached --name-only HEAD)" ]; then
git commit -m "chore: updated generated configuration" || echo "Lint-staged check failed"
git push origin HEAD:${{ github.ref_name }}
else
echo "No changes to commit"
fi
- uses: ubiquity-os/action-deploy-plugin@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
output.html
tests/__mocks__/results/output-reward-split.html
dist
Loading

0 comments on commit adde9f8

Please sign in to comment.