Skip to content

Commit

Permalink
add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyufjh committed Jan 12, 2025
1 parent 4d913e0 commit 752ca38
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 752ca38

Please sign in to comment.