|
1 | 1 | name: Build & Release Chrome Extension |
2 | 2 |
|
3 | | -permissions:missions: |
4 | | - contents: writents: write |
| 3 | +permissions: |
| 4 | + contents: write |
5 | 5 |
|
6 | 6 | on: |
7 | 7 | push: |
8 | | - tags: tags: |
9 | | - - 'v*.*.*' - 'v*.*.*' |
10 | | - workflow_dispatch:ow_dispatch: |
| 8 | + tags: |
| 9 | + - 'v*.*.*' |
| 10 | + workflow_dispatch: |
11 | 11 |
|
12 | | -jobs:jobs: |
| 12 | +jobs: |
13 | 13 | build: |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 |
|
16 | | - steps: steps: |
| 16 | + steps: |
17 | 17 | - name: Checkout code |
18 | 18 | uses: actions/checkout@v4 |
19 | 19 |
|
20 | | - - name: Set up Node.jsjs |
21 | | - uses: actions/setup-node@v4 uses: actions/setup-node@v4 |
| 20 | + - name: Set up Node.js |
| 21 | + uses: actions/setup-node@v4 |
22 | 22 | with: |
23 | | - node-version: 18-version: 18 |
| 23 | + node-version: 18 |
24 | 24 |
|
25 | | - - name: Install dependencies (if package.json exists)all dependencies (if package.json exists) |
26 | | - run: | | |
27 | | - if [ -f package.json ]; then if [ -f package.json ]; then |
| 25 | + - name: Install dependencies (if package.json exists) |
| 26 | + run: | |
| 27 | + if [ -f package.json ]; then |
28 | 28 | npm ci |
29 | 29 | fi |
30 | 30 |
|
31 | | - - name: Lint JavaScript (if eslint config exists)f eslint config exists) |
32 | | - run: | | |
33 | | - if [ -f package.json ] && [ -f .eslintrc ] || [ -f .eslintrc.js ] || [ -f .eslintrc.json ]; then if [ -f package.json ] && [ -f .eslintrc ] || [ -f .eslintrc.js ] || [ -f .eslintrc.json ]; then |
| 31 | + - name: Lint JavaScript (if eslint config exists) |
| 32 | + run: | |
| 33 | + if [ -f package.json ] && ([ -f .eslintrc ] || [ -f .eslintrc.js ] || [ -f .eslintrc.json ]); then |
34 | 34 | npx eslint . || true |
35 | 35 | fi |
36 | 36 |
|
37 | | - - name: Prepare extension ZIP - name: Prepare extension ZIP |
| 37 | + - name: Prepare extension ZIP |
38 | 38 | run: | |
39 | | - zip -r collab-ide-leetcode-extension.zip . -x "*.git*" "node_modules/*" "*.DS_Store" ".github/*"ension.zip . -x "*.git*" "node_modules/*" "*.DS_Store" ".github/*" |
| 39 | + zip -r collab-ide-leetcode-extension.zip . -x "*.git*" "node_modules/*" "*.DS_Store" ".github/*" |
40 | 40 |
|
41 | 41 | - name: Upload extension ZIP artifact |
42 | 42 | uses: actions/upload-artifact@v4 |
43 | | - with: with: |
44 | | - name: collab-ide-leetcode-extensionn |
45 | | - path: collab-ide-leetcode-extension.zipp |
| 43 | + with: |
| 44 | + name: collab-ide-leetcode-extension |
| 45 | + path: collab-ide-leetcode-extension.zip |
46 | 46 |
|
47 | | - - name: Create GitHub Release (on tag) Create GitHub Release (on tag) |
| 47 | + - name: Create GitHub Release (on tag) |
48 | 48 | if: startsWith(github.ref, 'refs/tags/') |
49 | | - uses: softprops/action-gh-release@v1: softprops/action-gh-release@v1 |
| 49 | + uses: softprops/action-gh-release@v1 |
50 | 50 | with: |
51 | | - files: collab-ide-leetcode-extension.zip files: collab-ide-leetcode-extension.zip |
52 | | - |
53 | | - |
54 | | - |
55 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} env: env: |
| 51 | + files: collab-ide-leetcode-extension.zip |
| 52 | + env: |
56 | 53 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments