diff --git a/.eslintignore b/.eslintignore index 841500ec..8f26e5a9 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,6 @@ -apidocs.js -deploy-docs.js -GruntFile.js +scripts/apidocs.js +scripts/release.js karma.conf.js -release.js webpack.config.js webpack.config.prod.js +version.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5071be7..6e2303b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,3 +41,4 @@ jobs: - run: sudo gem install sass -v 3.4.24 - run: npm ci - run: npm run linux:ci + \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 428050ec..e4ba23ee 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,3 +38,16 @@ jobs: - run: echo $alpha_version - run: npm --no-git-tag-version version $alpha_version - run: npm publish --tag next + + docs: + name: docs + runs-on: [ubuntu-latest] + # needs: deploy # to update homepage with latest release + + steps: + - name: Trigger docs deployment + uses: peter-evans/repository-dispatch@v1.1.3 + with: + repository: excaliburjs/excaliburjs.github.io + token: ${{ secrets.DOCS_GH_TOKEN }} + event-type: deploy-docs diff --git a/.npmignore b/.npmignore index c3d4bd81..761d3331 100644 --- a/.npmignore +++ b/.npmignore @@ -10,18 +10,16 @@ docs/ sandbox/ src/ typedoc-default-themes/ +scripts/ .tsbuildinfo .prettierignore .eslintignore .eslintrc.json -apidocs.js appveyor.yml -deploy-docs.js Excalibur.nuspec karma.conf.js prettier.config.js -release.js renovate.json version.js webpack.config.js diff --git a/README.md b/README.md index 119745f5..89a89d4d 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ npm run all # Run engine core compilation only # Useful for quick checks to ensure everything compiles -npm run core +npm run build # Run engine tests only (does not run compile task) # Useful to run tests ad-hoc diff --git a/deploy-docs.js b/deploy-docs.js deleted file mode 100644 index 66ec8c6c..00000000 --- a/deploy-docs.js +++ /dev/null @@ -1,41 +0,0 @@ -const { Octokit } = require('@octokit/rest'); - -const isPullRequest = !!process.env.GITHUB_BASE_REF; - -if (isPullRequest) { - console.log('Skipping docs deployment, detected pull request'); - return; -} - -const refName = process.env.GITHUB_REF?.split('/').pop(); -const refType = process.env.GITHUB_REF?.startsWith('refs/tags/') ? 'tag' : 'branch'; -const isMainBranch = refType === 'branch' && refName === 'main'; - -// build docs for tags and main only -if (refType === 'tag' || isMainBranch) { - console.log(`Current ${refType} is ``${refName}```); -} else { - console.log('Current ref is `' + refName + "` which isn't allowed, skipping docs deployment..."); - return; -} - -console.log('Triggering remote build of edge docs...'); - -const HTTP_204_CREATED = 204; -const octokit = new Octokit({ - auth: process.env.GITHUB_TOKEN || process.env.GH_TOKEN, - userAgent: 'excaliburjs-deploy-docs' -}); - -(async () => { - const { status, data } = await octokit.actions.createWorkflowDispatch({ - owner: 'excaliburjs', - repo: 'excaliburjs.github.io', - workflow_id: 'build.yml', - ref: 'site' - }); - - if (status !== HTTP_204_CREATED) { - console.error('Expected 204 Created success but instead got:', status, data); - } -})(); diff --git a/package.json b/package.json index 465e16f7..b7cb9666 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "appveyor": "npm run all && npm run nuget 0.0.1", "nuget": ".\\src\\tools\\NuGet.exe pack Excalibur.nuspec -OutputDirectory .\\build\\dist -version", "start": "npm run core:watch", + "build": "npm run core", "core": "npm run core:tsc && npm run core:copy && npm run core:bundle", "core:tsc": "tsc --project src/engine/tsconfig.json --incremental true --tsBuildInfoFile .tsbuildinfo", "core:copy": "copyfiles -u 2 ./src/engine/**/*.png ./src/engine/**/*.css ./src/engine/**/*.glsl ./build/dist/", @@ -49,9 +50,9 @@ "test": "karma start", "test:watch": "karma start --auto-watch --single-run=false", "coveralls": "coveralls < coverage/lcov.info", - "apidocs": "git submodule update && node apidocs.js", + "apidocs": "git submodule update && node scripts/apidocs.js", "pretty": "prettier --write \"{src,sandbox/src,sandbox/tests}/**/*.{ts,js,json,css,md}\" --config prettier.config.js", - "release": "node release.js" + "release": "node scripts/release.js" }, "husky": { "hooks": { diff --git a/apidocs.js b/scripts/apidocs.js similarity index 100% rename from apidocs.js rename to scripts/apidocs.js diff --git a/release.js b/scripts/release.js similarity index 100% rename from release.js rename to scripts/release.js