Skip to content

Commit

Permalink
feat: new UI and backend
Browse files Browse the repository at this point in the history
Thanks to @FjamZoo for reworking the backend to make this all possible.
  • Loading branch information
solareon authored Jul 2, 2024
2 parents edf7c29 + 1a4d3e6 commit 9d7b744
Show file tree
Hide file tree
Showing 56 changed files with 5,292 additions and 1,601 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ insert_final_newline = false
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
indent_size = 2
indent_style = space

[*.lua]
indent_size = 4
indent_style = space
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Main CI
on: [push, pull_request]
jobs:
build:
name: Build Test
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get Commit Range
id: get_commit_range
run: |
if [ "${{ github.event_name }}" == "push" ]; then
echo "commit_range=${{ github.event.before }}...${{ github.sha }}" >> $GITHUB_ENV
else
echo "commit_range=${{ github.event.pull_request.base.sha }}...${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Check for changes in UI directory
id: check_changes
run: |
if git diff --quiet ${{ env.commit_range }} -- ui; then
echo "No changes in UI directory. Skipping step."
echo "skip_step=true" >> $GITHUB_ENV
else
echo "Changes detected in UI directory. Proceeding with step."
echo "skip_step=false" >> $GITHUB_ENV
fi
- name: Install pnpm
if: env.skip_step == 'false'
uses: pnpm/action-setup@v4
with:
version: 9

- name: Setup node environment
if: env.skip_step == 'false'
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "ui/pnpm-lock.yaml"

- name: Install deps
if: env.skip_step == 'false'
run: pnpm install --frozen-lockfile
working-directory: ui

- name: Try build
if: env.skip_step == 'false'
run: pnpm build
working-directory: ui
env:
CI: true
13 changes: 4 additions & 9 deletions .github/workflows/debugbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: "Debug Build Action"

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the workflow on'
required: true
default: 'main'

jobs:
debug-build:
Expand Down Expand Up @@ -51,11 +46,11 @@ jobs:
mkdir -p ./temp/${{ github.event.repository.name }}/ui
cp ./{README.md,LICENSE,fxmanifest.lua} ./temp/${{ github.event.repository.name }}
cp -r ./{client,bridge,server} ./temp/${{ github.event.repository.name }}
cp -r ./ui/public ./temp/${{ github.event.repository.name }}/ui/public
cp -r ./ui/dist ./temp/${{ github.event.repository.name }}/ui/
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }}
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: debug-build
path: ${{ github.event.repository.name }}.zip
name: ${{ github.event.repository.name }}
path: ./temp/
14 changes: 13 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
- name: Check for lua changes
id: check_changes
run: |
if git diff --quiet HEAD^ HEAD -- '*.lua'; then
echo "No changes to lua files. Skipping step."
echo "skip_step=true" >> $GITHUB_ENV
else
echo "Changes detected to lua files. Proceeding with step."
echo "skip_step=false" >> $GITHUB_ENV
fi
- name: Lint
if: env.skip_step == 'false'
uses: iLLeniumStudios/fivem-lua-lint-action@v2
with:
capture: "junit.xml"
args: "-t --formatter JUnit"
extra_libs: ox_lib+mysql+qblocales+qbox+qbox_playerdata+qbox_lib
- name: Generate Lint Report
if: always()
if: env.skip_step == 'false'
uses: mikepenz/action-junit-report@v4
with:
report_paths: "**/junit.xml"
Expand Down
32 changes: 28 additions & 4 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,37 @@ jobs:
- name: Install ZIP
run: sudo apt install zip

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 9

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: "pnpm"
cache-dependency-path: "ui/pnpm-lock.yaml"

- name: Install dependencies
run: pnpm i --frozen-lockfile
working-directory: ui

- name: Run build
run: pnpm build
working-directory: ui
env:
CI: false

- name: Bundle files
run: |
rm -rf ./.github ./.vscode ./.git
shopt -s extglob
mkdir ./${{ github.event.repository.name }}
cp -r !(${{ github.event.repository.name }}) ${{ github.event.repository.name }}
zip -r ./${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }}
mkdir -p ./temp/${{ github.event.repository.name }}
mkdir -p ./temp/${{ github.event.repository.name }}/ui
cp ./{README.md,LICENSE,fxmanifest.lua} ./temp/${{ github.event.repository.name }}
cp -r ./{client,bridge,server} ./temp/${{ github.event.repository.name }}
cp -r ./ui/public ./temp/${{ github.event.repository.name }}/ui/public
cd ./temp && zip -r ../${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }}
- name: Get App Token
uses: actions/create-github-app-token@v1
Expand Down
Loading

0 comments on commit 9d7b744

Please sign in to comment.