|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint: |
| 13 | + name: Lint |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-latest] |
| 17 | + |
| 18 | + runs-on: ${{ matrix.os }} |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout codes |
| 22 | + uses: actions/checkout@v4 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Lint codes |
| 27 | + run: bun run lint |
| 28 | + |
| 29 | + build: |
| 30 | + name: Build |
| 31 | + strategy: |
| 32 | + matrix: |
| 33 | + os: [ubuntu-latest] |
| 34 | + node: [18.x] |
| 35 | + |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + |
| 38 | + steps: |
| 39 | + - name: Checkout codes |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Setup bun |
| 43 | + uses: oven-sh/setup-bun@v1 |
| 44 | + |
| 45 | + - name: Enable corepack |
| 46 | + run: corepack enable |
| 47 | + |
| 48 | + - name: Setup node |
| 49 | + uses: actions/setup-node@v3 |
| 50 | + with: |
| 51 | + node-version: ${{ matrix.node }} |
| 52 | + |
| 53 | + - name: Install dependencies |
| 54 | + run: bun install |
| 55 | + |
| 56 | + - name: Build codes |
| 57 | + run: bun run build |
| 58 | + |
| 59 | + test: |
| 60 | + name: Test |
| 61 | + strategy: |
| 62 | + matrix: |
| 63 | + os: [ubuntu-latest] |
| 64 | + node: [18.x] |
| 65 | + |
| 66 | + runs-on: ${{ matrix.os }} |
| 67 | + |
| 68 | + steps: |
| 69 | + - name: Checkout codes |
| 70 | + uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: Setup bun |
| 73 | + uses: oven-sh/setup-bun@v1 |
| 74 | + |
| 75 | + - name: Setup node |
| 76 | + uses: actions/setup-node@v3 |
| 77 | + with: |
| 78 | + node-version: ${{ matrix.node }} |
| 79 | + |
| 80 | + - name: Enable corepack |
| 81 | + run: corepack enable |
| 82 | + |
| 83 | + - name: Install dependencies |
| 84 | + run: bun install |
| 85 | + |
| 86 | + - name: Build codes |
| 87 | + run: bun run test |
| 88 | + |
| 89 | + edge-release: |
| 90 | + name: Edge Release |
| 91 | + needs: |
| 92 | + - lint |
| 93 | + - build |
| 94 | + - test |
| 95 | + runs-on: ${{ matrix.os }} |
| 96 | + strategy: |
| 97 | + matrix: |
| 98 | + os: [ubuntu-latest] |
| 99 | + node: [18] |
| 100 | + steps: |
| 101 | + - name: Checkout codes |
| 102 | + uses: actions/checkout@v4 |
| 103 | + |
| 104 | + - name: Setup bun |
| 105 | + uses: oven-sh/setup-bun@v1 |
| 106 | + |
| 107 | + - uses: actions/setup-node@v3 |
| 108 | + with: |
| 109 | + node-version: ${{ matrix.node }} |
| 110 | + |
| 111 | + - name: Enable corepack |
| 112 | + run: corepack enable |
| 113 | + |
| 114 | + - name: Install dependencies |
| 115 | + run: bun install |
| 116 | + |
| 117 | + - name: Build |
| 118 | + run: bun run build |
| 119 | + |
| 120 | + - name: Release Edge |
| 121 | + if: | |
| 122 | + github.event_name == 'push' && |
| 123 | + !startsWith(github.event.head_commit.message, '[skip-release]') && |
| 124 | + !startsWith(github.event.head_commit.message, 'chore') && |
| 125 | + !startsWith(github.event.head_commit.message, 'release') && |
| 126 | + !startsWith(github.event.head_commit.message, 'docs') |
| 127 | + run: ./scripts/release.sh |
| 128 | + env: |
| 129 | + NPM_TOKEN: ${{secrets.NPM_ORG_TOKEN}} |
| 130 | + EDGE_RELEASE: 'true' |
0 commit comments