Skip to content

Update embedBuilder.js #301

Update embedBuilder.js

Update embedBuilder.js #301

Workflow file for this run

name: Export and compile structures
on:
push:
branches:
- main
jobs:
compile-structures:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install all packages
run: CXXFLAGS=-std=c++17 npm ci |
CXXFLAGS=-std=c++17 npm run build --if-present
- name: Install JSDoc
run: npm install -g jsdoc
- name: Compile structures
run: |
for file in $(find ./src/structures -name '*.js');
do
echo "Compiling $file"
jsdoc -X $file > src/structures/compiled/$(basename "$file").json
done
output="// This file is automatically generated. Do not edit.\n"
for file in $(find ./src/structures/compiled -name '*.json');
do
echo "Adding file to export $file"
output="$output export { default as $(basename $file .js.json) } from './structures/compiled/$(basename $file)' with { type: 'json' };\n"
done
echo -e $output > ./src/compiledStructures.js
- name: Export structures
run: |
output="// This file is automatically generated. Do not edit.\n"
for file in $(find ./src/structures -name '*.js');
do
echo "Adding file to export $file"
output="$output export { default as $(basename $file .js) } from './structures/$(basename $file)';\n"
done
for file in $(find ./src/managers -name '*.js');
do
echo "Adding file to export $file"
output="$output export { default as $(basename $file .js) } from './managers/$(basename $file)';\n"
done
echo -e $output > ./src/structures.js
- name: Install TypeScript
run: npm install -g typescript
- name: Compile types
run: npx tsc
- name: Import bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: '["src/structures/compiled", "dist"]'
committer_email: [email protected]
committer_name: Starman