Skip to content

Commit

Permalink
Merge pull request #34 from gigamaster/dev-gui
Browse files Browse the repository at this point in the history
Dev gui
  • Loading branch information
gigamaster authored Nov 6, 2024
2 parents 41d0b7b + d7780ef commit 4f1220b
Show file tree
Hide file tree
Showing 104 changed files with 3,713 additions and 2,354 deletions.
10 changes: 5 additions & 5 deletions .bundlewatch.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ module.exports = {
// },
{
path: './build/livecodes/*.css',
maxSize: '15kB',
},
{
path: './build/livecodes/i18n-*.json',
maxSize: '10kB',
maxSize: '20kB',
},
// {
// path: './build/livecodes/i18n-*.json',
// maxSize: '10kB',
// },
],
defaultCompression: 'brotli',
normalizeFilenames: /^.+?((\.[^.]{8,}}?)|())\.\w+$/,
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/CI-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# - name: Cache Node modules
# id: cache-npm
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ matrix.node-version }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install dependencies
run: npm ci

Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/CI-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# - name: Cache Node modules
# id: cache-npm
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ matrix.node-version }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install dependencies
run: npm ci

Expand Down
24 changes: 10 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_ACTIONS_REPO_PAT }}
token: ${{ steps.generate-token.outputs.token }}

- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -27,23 +34,12 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# - name: Cache Node modules
# id: cache-npm
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.NODE_VERSION }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install dependencies
run: npm ci

- name: Deploy
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
npm run deploy -- -u "github-actions-bot <support+actions@github.com>"
npm run deploy -- -u "livecodes-ci[bot] <186997172+livecodes-ci[bot]@users.noreply.github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_REPO_PAT }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
8 changes: 8 additions & 0 deletions .github/workflows/i18n-update-notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged && github.event.sender.login != 'github-actions[bot]' && !startsWith(github.head_ref, 'i18n/')
steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Create comment on PR
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const commentBody = `## i18n Actions
Source PR has been merged into the default branch.
Expand Down
48 changes: 34 additions & 14 deletions .github/workflows/i18n-update-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID }}
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
NODE_VERSION: 18.x
CI: true

jobs:
precheck:
Expand All @@ -21,8 +22,17 @@ jobs:
branch: ${{ steps.fetch-pr.outputs.branch }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Fetch PR details
id: fetch-pr
Expand All @@ -40,15 +50,19 @@ jobs:
skip "Branch \`$PR_BRANCH\` is a i18n branch."
fi
PR_BRANCH=$(echo "$PR_DETAILS" | jq -r '.head.label' | sed 's/:/\//g')
NEW_BRANCH="i18n/$PR_BRANCH"
echo "newBranch=$NEW_BRANCH" >> $GITHUB_OUTPUT
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT
git config --global user.name "livecodes-ci[bot]"
git config --global user.email "186997172+livecodes-ci[bot]@users.noreply.github.com"
if [[ ! $(git ls-remote --heads origin $NEW_BRANCH) ]]; then
skip "Branch \`$NEW_BRANCH\` does not exist."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

runner:
name: Runner
Expand All @@ -60,10 +74,18 @@ jobs:
PR_BRANCH: ${{ needs.precheck.outputs.branch }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v4
with:
ref: ${{ needs.precheck.outputs.newBranch }}
token: ${{ steps.generate-token.outputs.token }}

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -72,17 +94,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# - name: Cache Node modules
# id: cache-npm
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.NODE_VERSION }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install dependencies
run: npm ci

Expand All @@ -97,8 +108,8 @@ jobs:

- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "livecodes-ci[bot]"
git config --global user.email "186997172+livecodes-ci[bot]@users.noreply.github.com"
git add .
# Only commit if there are changes
Expand All @@ -113,6 +124,7 @@ jobs:
- name: Create a new i18n PR, comment on source PR and reaction
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const repoURL = context.payload.repository.html_url;
const branchURL = `${repoURL}/tree/${process.env.NEW_BRANCH}`;
Expand Down Expand Up @@ -187,9 +199,17 @@ jobs:
SKIP_REASON: ${{ needs.precheck.outputs.skipReason }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Create reaction on PR
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const runURL = `${context.payload.repository.html_url}/actions/runs/${process.env.GITHUB_RUN_ID}`;
const commentBody = `## i18n Actions: \`.i18n-update-pull\`
Expand Down
50 changes: 36 additions & 14 deletions .github/workflows/i18n-update-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ env:
LOKALISE_PROJECT_ID: ${{ vars.LOKALISE_PROJECT_ID }}
LOKALISE_API_TOKEN: ${{ secrets.LOKALISE_API_TOKEN }}
NODE_VERSION: 18.x
CI: true

jobs:
precheck:
Expand All @@ -21,8 +22,17 @@ jobs:
branch: ${{ steps.fetch-pr.outputs.branch }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Fetch PR details
id: fetch-pr
Expand All @@ -37,18 +47,23 @@ jobs:
echo "skipReason=$SKIP_REASON" >> $GITHUB_OUTPUT
fi
# Use branch name prefixed with owner name
PR_BRANCH=$(echo "$PR_DETAILS" | jq -r '.head.label' | sed 's/:/\//g')
NEW_BRANCH="i18n/$PR_BRANCH"
echo "newBranch=$NEW_BRANCH" >> $GITHUB_OUTPUT
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT
git config --global user.name "livecodes-ci[bot]"
git config --global user.email "186997172+livecodes-ci[bot]@users.noreply.github.com"
if [[ $(git ls-remote --heads origin $NEW_BRANCH) ]]; then
SKIP_REASON="Branch \`$NEW_BRANCH\` already exists."
echo "$SKIP_REASON Exiting..."
echo "skip=true" >> $GITHUB_OUTPUT
echo "skipReason=$SKIP_REASON" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

runner:
name: Runner
Expand All @@ -60,8 +75,17 @@ jobs:
PR_BRANCH: ${{ needs.precheck.outputs.branch }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -70,17 +94,6 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# - name: Cache Node modules
# id: cache-npm
# uses: actions/cache@v4
# with:
# path: ~/.npm
# key: ${{ runner.os }}-build-${{ env.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.NODE_VERSION }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-

- name: Install dependencies
run: npm ci

Expand All @@ -92,8 +105,8 @@ jobs:

- name: Commit changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "livecodes-ci[bot]"
git config --global user.email "186997172+livecodes-ci[bot]@users.noreply.github.com"
git add .
# Only commit if there are changes
Expand All @@ -111,6 +124,7 @@ jobs:
- name: Create comment and reaction on PR
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const repoURL = context.payload.repository.html_url;
const branchURL = `${repoURL}/tree/${process.env.NEW_BRANCH}`;
Expand Down Expand Up @@ -148,9 +162,17 @@ jobs:
SKIP_REASON: ${{ needs.precheck.outputs.skipReason }}

steps:
- name: Generate Github Token for CI Bot
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ secrets.CI_APP_ID }}
private-key: ${{ secrets.CI_APP_PRIVATE_KEY }}

- name: Create comment and reaction on PR
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
const runURL = `${context.payload.repository.html_url}/actions/runs/${process.env.GITHUB_RUN_ID}`;
const commentBody = `## i18n Actions: \`.i18n-update-push\`
Expand Down
Loading

0 comments on commit 4f1220b

Please sign in to comment.