|
| 1 | +name: PACKAGE |
| 2 | + |
| 3 | +# Cancel prev CI if new commit come |
| 4 | +concurrency: |
| 5 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 6 | + cancel-in-progress: true |
| 7 | + |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + - v*.* |
| 14 | + pull_request: |
| 15 | + branches: |
| 16 | + - main |
| 17 | + - v*.* |
| 18 | + paths: |
| 19 | + - 'packages/**' |
| 20 | + - package.json |
| 21 | + - yarn.lock |
| 22 | + |
| 23 | +jobs: |
| 24 | + build: |
| 25 | + runs-on: ${{ matrix.os }} |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + os: [macos-latest, ubuntu-latest] |
| 29 | + node-version: [20.x] |
| 30 | + |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v4 |
| 33 | + - name: Use Node.js ${{ matrix.node-version }} |
| 34 | + uses: actions/setup-node@v4 |
| 35 | + with: |
| 36 | + node-version: ${{ matrix.node-version }} |
| 37 | + - name: Get yarn cache directory path |
| 38 | + id: yarn_cache_dir_path |
| 39 | + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT |
| 40 | + |
| 41 | + - uses: actions/cache@v4 |
| 42 | + id: yarn_cache |
| 43 | + with: |
| 44 | + path: ${{ steps.yarn_cache_dir_path.outputs.dir }} |
| 45 | + key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} |
| 46 | + restore-keys: | |
| 47 | + ${{ runner.os }}-yarn- |
| 48 | +
|
| 49 | + - name: Install |
| 50 | + run: | |
| 51 | + yarn install --immutable |
| 52 | +
|
| 53 | + - name: Build |
| 54 | + run: | |
| 55 | + yarn run electron-rebuild |
| 56 | +
|
| 57 | + - name: Package |
| 58 | + run: | |
| 59 | + yarn run package |
| 60 | +
|
| 61 | + build-windows: |
| 62 | + runs-on: windows-2019 |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v4 |
| 65 | + - name: Use Node.js 20.x |
| 66 | + uses: actions/setup-node@v4 |
| 67 | + with: |
| 68 | + node-version: 20.x |
| 69 | + - name: Get yarn cache directory path |
| 70 | + id: yarn_cache_dir_path |
| 71 | + run: echo "dir=$(yarn config get cacheFolder)" >> $Env:GITHUB_OUTPUT |
| 72 | + |
| 73 | + - uses: actions/cache@v4 |
| 74 | + id: yarn_cache |
| 75 | + with: |
| 76 | + path: ${{ steps.yarn_cache_dir_path.outputs.dir }} |
| 77 | + key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} |
| 78 | + restore-keys: | |
| 79 | + ${{ runner.os }}-yarn- |
| 80 | + - name: Install |
| 81 | + run: | |
| 82 | + yarn install --immutable |
| 83 | +
|
| 84 | + - name: Build |
| 85 | + run: | |
| 86 | + yarn run electron-rebuild |
| 87 | +
|
| 88 | + - name: Package |
| 89 | + run: | |
| 90 | + yarn run package |
0 commit comments