diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index e34c77fdb..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,85 +0,0 @@ -name: Build - -on: - workflow_dispatch: - inputs: - buildApp: - description: "Include Application Build" - type: boolean - default: "true" - required: true - buildDoc: - description: "Include Documentation Build" - type: boolean - default: "true" - required: true - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - name: Build - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13.1 - uses: actions/setup-node@v2 - with: - node-version: 16.13.1 - cache: "npm" - - - name: Install NPM dependencies - run: npm ci - - - name: Build Production App - if: ${{ github.event.inputs.buildApp == 'true' }} - run: npm run build - - uses: actions/upload-artifact@v3 - if: ${{ github.event.inputs.buildApp == 'true' }} - with: - name: app - path: | - dist/main.bundle.js - dist/main.bundle.js.map - dist/vendor.bundle.js - dist/vendor.bundle.js.map - index.html - expire-on: never - - - name: Build Documentation - if: ${{ github.event.inputs.buildDoc == 'true' }} - run: npm run doc - - uses: actions/upload-artifact@v3 - if: ${{ github.event.inputs.buildDoc == 'true' }} - with: - name: markdown - path: markdown/ - expire-on: never - deploy: - needs: build - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 - with: - artifact_name: app diff --git a/.github/workflows/check-for-generated-files.yml b/.github/workflows/check-for-generated-files.yml index 6d29c3ea8..73641d16c 100644 --- a/.github/workflows/check-for-generated-files.yml +++ b/.github/workflows/check-for-generated-files.yml @@ -23,15 +23,6 @@ jobs: files: | dist/* index.html - main.bundle.js - main.bundle.js.map - - - name: Check documentation changes - id: changed-markdown-doc-files - uses: tj-actions/changed-files@v18.4 - with: - files: | - markdown/*.md - name: Warn when bundle files were changed id: warn-bundles-changed @@ -51,14 +42,14 @@ jobs: echo "Forbidden files included, generating warning" touch comment.txt - echo "## Generated build or documentation files were included. PRs should not normally contain any generated files." >> comment.txt + echo "## Generated build files were included. PRs should not normally contain generated files." >> comment.txt echo "" >> comment.txt - echo "Review the changes and ensure that including built files was necessary." >> comment.txt + echo "Review the changes and ensure that including generated files was necessary." >> comment.txt echo "Add pr label" gh --repo "${{ github.repository }}" \ pr edit "${{ github.event.number }}" --add-label "$LABEL" echo "And comment on the pr" gh --repo "${{ github.repository }}" \ - pr comment "${{ github.event.number }}" --body-file comment.txt + pr comment "${{ github.event.number }}" --body-file comment.txt --edit-last fi diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml deleted file mode 100644 index d109f0b0c..000000000 --- a/.github/workflows/ci-pr.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: CI Pull Request - -on: - # Triggers the workflow on pull request events but only for the dev branch - pull_request: - branches: [dev] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 16.13.1 - uses: actions/setup-node@v2 - with: - node-version: 16.13.1 - cache: "npm" - - name: Install npm dependencies - run: npm ci - - name: Build the production app - run: npm run build - lint: - name: Lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Use Node.js 16.13.1 - uses: actions/setup-node@v2 - with: - node-version: 16.13.1 - cache: "npm" - - name: Install npm dependencies - run: npm ci - - name: Run linter - run: npm run lint:report - prettier: - name: Prettier - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Use Node.js 16.13.1 - uses: actions/setup-node@v2 - with: - node-version: 16.13.1 - cache: "npm" - - name: Install npm dependencies - run: npm ci - - name: Run prettier check - run: npm run format:report - test: - name: Test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Use Node.js 16.13.1 - uses: actions/setup-node@v2 - with: - node-version: 16.13.1 - cache: "npm" - - name: Install npm dependencies - run: npm ci - - name: Run tests - run: npm run test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f75d20d2..27e703df6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,11 @@ name: CI on: - # Triggers the workflow on push events but only for the dev branch + # Triggers the workflow on push events and pull requests but only for the dev branch push: branches: [dev] + pull_request: + branches: [dev] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -13,7 +15,7 @@ jobs: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.13.1 uses: actions/setup-node@v2 with: @@ -27,7 +29,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.13.1 uses: actions/setup-node@v2 with: @@ -41,7 +43,7 @@ jobs: name: Prettier runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.13.1 uses: actions/setup-node@v2 with: @@ -55,7 +57,7 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use Node.js 16.13.1 uses: actions/setup-node@v2 with: diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 6e9237fb2..5fe371625 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -1,4 +1,4 @@ -name: "Deploy new dev build" +name: "Deploy new pages build" on: workflow_dispatch: @@ -20,8 +20,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - fetch-depth: 0 - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/package-lock.json b/package-lock.json index 8f9f27913..a6b87f672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "@typescript-eslint/parser": "^5.48.0", "babel-jest": "^29.3.1", "babel-loader": "^9.1.2", - "electron": "^22.0.0", + "electron": "^22.2.1", "electron-packager": "^17.1.1", "eslint": "^8.31.0", "file-loader": "^6.2.0", @@ -7088,9 +7088,9 @@ "dev": true }, "node_modules/electron": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-22.0.0.tgz", - "integrity": "sha512-cgRc4wjyM+81A0E8UGv1HNJjL1HBI5cWNh/DUIjzYvoUuiEM0SS0hAH/zaFQ18xOz2ced6Yih8SybpOiOYJhdg==", + "version": "22.2.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-22.2.1.tgz", + "integrity": "sha512-gPO9IYXCfG+BJnS9WRN/jkBSbnzrIU26IKfDpUAWgqDJNCCfSKHrQJ3kv55RW9gUtPdzYwmhVRHySXd6v9Rzmg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -21258,9 +21258,9 @@ "dev": true }, "electron": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-22.0.0.tgz", - "integrity": "sha512-cgRc4wjyM+81A0E8UGv1HNJjL1HBI5cWNh/DUIjzYvoUuiEM0SS0hAH/zaFQ18xOz2ced6Yih8SybpOiOYJhdg==", + "version": "22.2.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-22.2.1.tgz", + "integrity": "sha512-gPO9IYXCfG+BJnS9WRN/jkBSbnzrIU26IKfDpUAWgqDJNCCfSKHrQJ3kv55RW9gUtPdzYwmhVRHySXd6v9Rzmg==", "dev": true, "requires": { "@electron/get": "^2.0.0", diff --git a/package.json b/package.json index 9f1094215..0d7cdb349 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "@typescript-eslint/parser": "^5.48.0", "babel-jest": "^29.3.1", "babel-loader": "^9.1.2", - "electron": "^22.0.0", + "electron": "^22.2.1", "electron-packager": "^17.1.1", "eslint": "^8.31.0", "file-loader": "^6.2.0", @@ -100,22 +100,20 @@ }, "scripts": { "doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input && git add markdown/ && git add tsdoc-metadata.json", - "format": "prettier --write .", + "format": "prettier -c --write .", "format:report": "prettier -c .", - "start": "http-server -p 8000", + "start": "cd .app && http-server -p 8000", "start:dev": "webpack serve --progress --env devServer --mode development", "build": "bash ./tools/build.sh production", "build:dev": "bash ./tools/build.sh development", "lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 src", - "lint:report": "eslint --ext js,jsx,ts,tsx --max-warnings 0 src", "preinstall": "node ./tools/engines-check/engines-check.js", - "postinstall": "cd electron && npm install", "test": "jest", "test:watch": "jest --watch", "watch": "webpack --watch --mode production", "watch:dev": "webpack --watch --mode development", "electron": "bash ./tools/package-electron.sh", - "allbuild": "npm run build && npm run electron && git add --all && git commit -m \"allbuild commit $(git rev-parse --short HEAD)\" && git push -u origin dev", + "electron:packager-all": "electron-packager .package bitburner --platform all --arch x64,armv7l,arm64,mips64el --out .build --overwrite --icon .package/icon.png", "preversion": "npm install && npm run test", "version": "sh ./tools/build-release.sh && git add --all", "postversion": "git push -u origin dev && git push --tags",