diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0984514 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,63 @@ +name: Build Extension + +on: + push: + branches: [ main ] + tags: [ 'v*' ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + + - name: Install dependencies + run: | + npm ci + cd ArkPets-Web && npm ci + + - name: Run lint + run: npm run lint + + - name: Run tests + run: npm run test + + - name: Build Chrome version + run: ./build.sh -t chrome + + - name: Build Edge version + run: ./build.sh -t edge + + - name: Upload Chrome artifact + uses: actions/upload-artifact@v4 + with: + name: chrome-extension + path: arkpets-chrome-*.zip + + - name: Upload Edge artifact + uses: actions/upload-artifact@v4 + with: + name: edge-extension + path: arkpets-edge-*.zip + + # Create GitHub Release when a tag is pushed + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: | + arkpets-chrome-*.zip + arkpets-edge-*.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/package.json b/package.json index 2ff33e7..0a6c9f2 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "watch": "webpack build --watch --mode development", "build": "webpack --mode production", "lint": "eslint src", - "test": "vitest" + "test": "vitest run" }, "dependencies": { "@radix-ui/react-dialog": "^1.1.4",