Some dev updates

* Bump electron version to 22.2.1
* Fix npm run electron command (needed the electron-packager-all command which I had removed)
* Improve the npm run format command, no longer floods terminal with all file names
* Updated start command to serve the built version of the game in .app
* Remove some unused commands and unused workflows. Combined the ci and ci-pr workflows.
* Modify check for generated files logic. Attempt to fix so it will edit its own comment instead of posting a new one on every commit.
This commit is contained in:
omuretsu
2023-02-11 15:12:55 -05:00
parent 6a6043c509
commit e9bdc29c8c
7 changed files with 22 additions and 189 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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