diff --git a/.github/workflows/build-client.yml b/.github/workflows/build-client.yml new file mode 100644 index 0000000..4e21b9e --- /dev/null +++ b/.github/workflows/build-client.yml @@ -0,0 +1,44 @@ +name: Build Client + +on: + push: + branches: + - master + tags: + - "v*" + pull_request: + branches: + - master + +jobs: + # + # Build the Spoolman client for people to download + # + build-client: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install dependencies + run: | + cd client + npm ci + + - name: Build + run: | + cd client + rm -f .env && echo "VITE_APIURL=/api/v1" > .env.production + npm run build + npm run build.zip + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: spoolman-client.zip + path: client/dist/spoolman-client.zip diff --git a/client/.prettierrc b/client/.prettierrc index 9bd5691..e723339 100644 --- a/client/.prettierrc +++ b/client/.prettierrc @@ -2,7 +2,7 @@ "printWidth": 120, "overrides": [ { - "files": ["*.json"], + "files": ["public/locales/**/*.json"], "options": { "tabWidth": 4 } diff --git a/client/package.json b/client/package.json index 1526f53..d6d5f33 100644 --- a/client/package.json +++ b/client/package.json @@ -48,6 +48,7 @@ "scripts": { "dev": "refine dev", "build": "tsc && refine build", + "build.zip": "cd ./dist && zip -r spoolman-client.zip ./ ./ && cd ..", "preview": "refine start", "refine": "refine" },