diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c8cda3e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: ci +on: + push: + branches: + - master + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: mkdocs gh-deploy --force diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 324752c..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Documentation - -on: - release: - types: [published] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: pages - cancel-in-progress: false - -jobs: - # Build job - build-docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: npm - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Install dependencies - run: npm ci - - name: Build with VitePress - run: | - npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build - touch docs/.vitepress/dist/.nojekyll - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: docs/.vitepress/dist - - # Deployment job - deploy-docs: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - needs: build-docs - runs-on: ubuntu-latest - name: Deploy - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/event.yml b/.github/workflows/event.yml index 0e3a2d0..8e86112 100644 --- a/.github/workflows/event.yml +++ b/.github/workflows/event.yml @@ -1,8 +1,6 @@ name: Event on: - pull_request: - types: [opened] issues: types: [opened] @@ -22,12 +20,7 @@ jobs: WEBHOOK_URL: ${{ secrets.EVENT_WEBHOOK_URL }} run: | PROJECT="${{ github.repository }}" - if [ "${{ github.event_name }}" == "issues" ]; then - EVENT_URL="${{ github.event.issue.html_url }}" - EVENT_TITLE="${{ github.event.issue.title }}" - elif [ "${{ github.event_name }}" == "pull_request" ]; then - EVENT_URL="${{ github.event.pull_request.html_url }}" - EVENT_TITLE="${{ github.event.pull_request.title }}" - fi + EVENT_URL="${{ github.event.issue.html_url }}" + EVENT_TITLE="${{ github.event.issue.title }}" - lune run .lune/discord.luau "$WEBHOOK_URL" "event" "$PROJECT" "$EVENT_TITLE" "$EVENT_URL" \ No newline at end of file + lune run .lune/discord.luau "$WEBHOOK_URL" "event" "$PROJECT" "$EVENT_TITLE" "$EVENT_URL" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2f175ee..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish -on: - release: - types: [published] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -jobs: - # Announce on Discord - announce: - name: Announce on Discord - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Rokit - uses: CompeyDev/setup-rokit@v0.1.0 - - - name: Send webhook - env: - WEBHOOK_URL: ${{ secrets.UPDATE_WEBHOOK_URL }} - run: | - PROJECT="${{ github.repository }}" - VERSION="${{ github.ref_name }}" - lune run .lune/discord.luau "$WEBHOOK_URL" "announcement" "$PROJECT" "$VERSION" - - # Publish to wally - publish-wally: - name: Publish package to Wally - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Rokit - uses: CompeyDev/setup-rokit@v0.1.0 - - - name: Log In - env: - WALLY_AUTH: ${{ secrets.WALLY_AUTH_TOKEN }} - run: | - mkdir ~/.wally - printenv WALLY_AUTH > ~/.wally/auth.toml - - - name: Publish - run: | - wally publish \ No newline at end of file diff --git a/.github/workflows/draft.yml b/.github/workflows/release.yml similarity index 64% rename from .github/workflows/draft.yml rename to .github/workflows/release.yml index 0a26a74..c909a51 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,9 @@ on: - 'v*.*.*' permissions: - contents: write + contents: write + pages: write + id-token: write jobs: bump: @@ -46,8 +48,8 @@ jobs: git tag -f ${{ github.ref_name }} git push -f --tags - draft-build: - name: Draft & Build Assets + publish-build: + name: Publish Assets runs-on: ubuntu-latest needs: bump steps: @@ -63,7 +65,7 @@ jobs: - name: Generate sourcemap run: argon sourcemap standalone.project.json --output sourcemap.json - - name: Generate Wally types + - name: Generate package types run: wally-package-types --sourcemap sourcemap.json Packages - name: Format code @@ -77,10 +79,50 @@ jobs: with: tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} - draft: true prerelease: ${{ contains(github.ref_name, 'rc') }} body: | ## Changelog ${{ needs.bump.outputs.release-body }} files: | - ./Standalone.rbxm \ No newline at end of file + ./Standalone.rbxm + + publish-package: + name: Publish Package + runs-on: ubuntu-latest + needs: bump + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rokit + uses: CompeyDev/setup-rokit@v0.1.0 + + - name: Log In + env: + WALLY_AUTH: ${{ secrets.WALLY_AUTH_TOKEN }} + run: | + mkdir ~/.wally + printenv WALLY_AUTH > ~/.wally/auth.toml + + - name: Publish + run: | + wally publish + + publish-announcement: + name: Publish Announcement + runs-on: ubuntu-latest + needs: [publish-package, publish-build] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Rokit + uses: CompeyDev/setup-rokit@v0.1.0 + + - name: Send webhook + env: + WEBHOOK_URL: ${{ secrets.UPDATE_WEBHOOK_URL }} + run: | + PROJECT="${{ github.repository }}" + VERSION="${{ github.ref_name }}" + lune run .lune/discord.luau "$WEBHOOK_URL" "announcement" "$PROJECT" "$VERSION" diff --git a/.gitignore b/.gitignore index e0df275..4d6b2b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ -# Vitepress -docs/.vitepress/cache -docs/.vitepress/dist - -# Node -node_modules +# Mkdocs +venv # Wally Packages @@ -11,4 +7,4 @@ DevPackages wally.lock # Argon -sourcemap.json \ No newline at end of file +sourcemap.json diff --git a/.lune/discord.luau b/.lune/discord.luau index f846af4..10ae7c0 100644 --- a/.lune/discord.luau +++ b/.lune/discord.luau @@ -2,13 +2,15 @@ local net = require("@lune/net") local process = require("@lune/process") local projectRole = "1277040514205614141" -local projectMainterRole = "1277040552012943411" local webhook_url = process.args[1] local type = process.args[2] local project = process.args[3] local projectName = string.split(project, "/")[2] +local formattedProjectName = string.gsub(projectName, "^%a", function(match) + return string.upper(match) +end) if type == "announcement" then local tag = process.args[4] @@ -21,9 +23,9 @@ if type == "announcement" then content = if noPing == true then nil else `<@&{projectRole}>`, embeds = { { - title = `Release {tag} · lumin-dev/{projectName}`, - description = `Release notification for the latest version of {projectName}`, - url = `https://github.com/lumin-dev/{projectName}/releases/tag/{tag}`, + title = `Release {tag} · {formattedProjectName}`, + description = `Release notification for the latest version of {formattedProjectName}`, + url = `https://github.com/luminlabsdev/{projectName}/releases/tag/{tag}`, color = 7506646, author = { name = "GitHub", @@ -43,18 +45,17 @@ elseif type == "event" then method = "POST", headers = { ["Content-Type"] = "application/json" }, body = net.jsonEncode({ - content = `<@&{projectMainterRole}>`, embeds = { { title = title, - description = `[View issue/pull request]({url})`, + description = `[View issue]({url})`, color = 7506646, }, }, - thread_name = `{projectName} - {title}`, + thread_name = `{formattedProjectName} - {title}`, }), }) if not response.ok then error(`{response.statusCode}:{response.statusMessage}`) end -end \ No newline at end of file +end diff --git a/README.md b/README.md index 588d1f3..63ca4bb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -
+# Plugin Framework -# Lumin Plugin Framework +[![license](https://img.shields.io/github/license/luminlabsdev/plugin-framework)](https://github.com/luminlabsdev/plugin-framework/blob/main/LICENSE) +[![release](https://img.shields.io/github/v/release/luminlabsdev/plugin-framework)](https://github.com/luminlabsdev/plugin-framework/releases/latest) +[![discord](https://img.shields.io/discord/1105688855375511642?logo=discord&logoColor=white&label=discord&color=4d3dff)](https://luminlabsdev.github.io/link/discord) An extension of Lumin Framework with added plugin support and methods. - -
\ No newline at end of file diff --git a/default.project.json b/default.project.json index 6212013..ea5ea33 100644 --- a/default.project.json +++ b/default.project.json @@ -1,6 +1,6 @@ { - "name": "PluginFramework", + "name": "framework", "tree": { "$path": "src" } -} \ No newline at end of file +} diff --git a/dev.project.json b/dev.project.json index d5e50c3..a727982 100644 --- a/dev.project.json +++ b/dev.project.json @@ -1,12 +1,12 @@ { "legacyScripts": true, - "name": "PluginFramework", + "name": "framework", "tree": { "$className": "DataModel", "ReplicatedStorage": { "Plugin": { "$path": "Packages", - "plugin_framework": { + "framework": { "$path": "src" }, "Test": { @@ -15,4 +15,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/init.luau b/src/init.luau index b4033b0..648afa0 100644 --- a/src/init.luau +++ b/src/init.luau @@ -15,10 +15,11 @@ local Menu = require(Library.Menu) return { Start = Lumin.Start, - Controller = Lumin.Controller, - Expect = Lumin.Expect, + OnStart = Lumin.OnStart, + New = Lumin.New, Worker = Lumin.Worker, - Signal = Lumin.Signal, + Load = Lumin.Load, + version = "0.2.0", Unloading = plugin.Unloading, diff --git a/standalone.project.json b/standalone.project.json index 4f47861..e3c80c6 100644 --- a/standalone.project.json +++ b/standalone.project.json @@ -2,8 +2,8 @@ "name": "standalone", "tree": { "$path": "Packages", - "PluginFramework": { + "framework": { "$path": "src" } } -} \ No newline at end of file +} diff --git a/wally.toml b/wally.toml index 95da275..49d8ce4 100644 --- a/wally.toml +++ b/wally.toml @@ -5,4 +5,4 @@ registry = "https://github.com/UpliftGames/wally-index" realm = "shared" [dependencies] -framework = "lumin/framework@9.0.0-rc6" \ No newline at end of file +framework = "lumin/framework@9.0.0-rc7"