Skip to content

Commit

Permalink
Merge pull request #2 from ubq-testing/development
Browse files Browse the repository at this point in the history
V2 init
  • Loading branch information
ubiquity-os[bot] authored Oct 12, 2024
2 parents 1c81f05 + e52735d commit 77a12d5
Show file tree
Hide file tree
Showing 71 changed files with 6,498 additions and 1,750 deletions.
19 changes: 17 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts"],
"ignorePaths": ["**/*.json", "**/*.css", "node_modules", "**/*.log", "./src/adapters/supabase/**/**.ts", "supabase/config.toml"],
"useGitignore": true,
"language": "en",
"words": [
"setwebhook",
"Nektos",
"dataurl",
"devpool",
Expand All @@ -20,7 +21,21 @@
"Typeguards",
"sonarjs",
"knip",
"mischeck"
"mischeck",
"Hono",
"hono",
"mtproto",
"grammyjs",
"setcommands",
"grammyjs",
"botid",
"chatid",
"myid",
"baseclass",
"unarchived",
"libsodium",
"binkey",
"binsec"
],
"dictionaries": ["typescript", "node", "software-terms"],
"import": ["@cspell/dict-typescript/cspell-ext.json", "@cspell/dict-node/cspell-ext.json", "@cspell/dict-software-terms"],
Expand Down
2 changes: 1 addition & 1 deletion .dev.vars.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MY_SECRET="MY_SECRET"
TELEGRAM_BOT_ENV=
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
MY_SECRET="MY_SECRET"
# Only `yarn setup-env` requires these variables to be set
TELEGRAM_BOT_REPOSITORY_FULL_NAME=
GITHUB_PAT_TOKEN=
2 changes: 1 addition & 1 deletion .github/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const config: KnipConfig = {
ignore: ["src/types/config.ts", "**/__mocks__/**", "**/__fixtures__/**"],
ignoreExportsUsedInFile: true,
// eslint can also be safely ignored as per the docs: https://knip.dev/guides/handling-issues#eslint--jest
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@mswjs/data"],
ignoreDependencies: ["eslint-config-prettier", "eslint-plugin-prettier", "@mswjs/data", "smee-client", "supabase"],
eslint: true,
};

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/compute.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "the name of the plugin"
name: "Workflow Functions"

on:
workflow_dispatch:
Expand All @@ -18,12 +18,11 @@ on:

jobs:
compute:
name: "plugin name"
name: "Kernel-Telegram"
runs-on: ubuntu-latest
permissions: write-all
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
TELEGRAM_BOT_ENV: ${{ secrets.TELEGRAM_BOT_ENV }}

steps:
- uses: actions/checkout@v4
Expand All @@ -36,9 +35,11 @@ jobs:
- name: install dependencies
run: yarn

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

- name: execute directive
run: npx tsx ./src/main.ts
id: plugin-name
run: npx tsx ./src/workflow-entry.ts
id: Kernel-Telegram
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
TELEGRAM_BOT_ENV: ${{ secrets.TELEGRAM_BOT_ENV }}
2 changes: 1 addition & 1 deletion .github/workflows/worker-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Retrieve and Construct Full Worker Name
id: construct_worker_name
run: |
base_name=$(grep '^name = ' wrangler.toml | sed 's/^name = "\(.*\)"$/\1/')
base_name=$(grep '^name = ' wrangler.toml | head -n 1 | sed 's/^name = "\(.*\)"$/\1/')
full_worker_name="${base_name}-${{ env.branch_name }}"
# Make sure that it doesnt exceed 63 characters or it will break RFC 1035
full_worker_name=$(echo "${full_worker_name}" | cut -c 1-63)
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/worker-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,24 @@ jobs:
run: |
branch_name=$(echo '${{ github.event.ref }}' | sed 's#refs/heads/##' | sed 's#[^a-zA-Z0-9]#-#g')
# Extract base name from wrangler.toml
base_name=$(grep '^name = ' wrangler.toml | sed 's/^name = "\(.*\)"$/\1/')
base_name=$(grep '^name = ' wrangler.toml | head -n 1 | sed 's/^name = "\(.*\)"$/\1/')
# Concatenate branch name with base name
new_name="${base_name}-${branch_name}"
# Truncate the new name to 63 characters for RFC 1035
new_name=$(echo "$new_name" | cut -c 1-63)
# Update the wrangler.toml file
sed -i "s/^name = .*/name = \"$new_name\"/" wrangler.toml
sed -i '0,/^name = .*/{s/^name = .*/name = "'"$new_name"'"/}' wrangler.toml
echo "Updated wrangler.toml name to: $new_name"
- name: Deploy with Wrangler
id: wrangler_deploy
uses: cloudflare/wrangler-action@v3
with:
wranglerVersion: "3.57.0"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
secrets: |
SUPABASE_URL
SUPABASE_KEY
TELEGRAM_BOT_ENV
env:
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
TELEGRAM_BOT_ENV: ${{ secrets.TELEGRAM_BOT_ENV }}

- name: Write Deployment URL to Summary
run: |
Expand Down
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,37 @@ cypress/screenshots
script.ts
.wrangler
test-dashboard.md

# prod
dist/

# dev
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf

# deps
node_modules/
.wrangler

# env
.env
.env.production
.dev.vars

# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# misc
.DS_Store
Loading

0 comments on commit 77a12d5

Please sign in to comment.