|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + runs-on: ${{ matrix.os }} |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + node: |
| 13 | + - 10 |
| 14 | + - 12 |
| 15 | + - 14 |
| 16 | + os: |
| 17 | + - macOS-latest |
| 18 | + - ubuntu-16.04 |
| 19 | + - windows-latest |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - uses: actions/setup-node@v2 |
| 23 | + with: |
| 24 | + node-version: ${{ matrix.node }} |
| 25 | + - run: npm install |
| 26 | + - run: npm test |
| 27 | + - run: npm run prebuild |
| 28 | + if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/') |
| 29 | + - run: npm run prebuild-ia32 |
| 30 | + if: |
| 31 | + matrix.node == 14 && matrix.os == 'windows-latest' && |
| 32 | + startsWith(github.ref, 'refs/tags/') |
| 33 | + - run: npm run prebuild-linux-arm |
| 34 | + if: |
| 35 | + matrix.node == 14 && matrix.os == 'ubuntu-16.04' && |
| 36 | + startsWith(github.ref, 'refs/tags/') |
| 37 | + - uses: actions/upload-artifact@v2 |
| 38 | + if: matrix.node == 14 && startsWith(github.ref, 'refs/tags/') |
| 39 | + with: |
| 40 | + name: ${{ matrix.os }} |
| 41 | + path: prebuilds |
| 42 | + release: |
| 43 | + if: startsWith(github.ref, 'refs/tags/') |
| 44 | + needs: test |
| 45 | + runs-on: ubuntu-16.04 |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - uses: actions/download-artifact@v2 |
| 49 | + with: |
| 50 | + path: prebuilds |
| 51 | + - run: echo ::set-output name=version::$(git describe --tags) |
| 52 | + id: get_version |
| 53 | + - run: |
| 54 | + tar -cvf "${{ steps.get_version.outputs.version }}-darwin-x64.tar" -C |
| 55 | + "prebuilds/macOS-latest" . |
| 56 | + - run: |
| 57 | + tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm.tar" -C |
| 58 | + "prebuilds/ubuntu-16.04" linux-arm |
| 59 | + - run: |
| 60 | + tar -cvf "${{ steps.get_version.outputs.version }}-linux-arm64.tar" -C |
| 61 | + "prebuilds/ubuntu-16.04" linux-arm64 |
| 62 | + - run: |
| 63 | + tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C |
| 64 | + "prebuilds/ubuntu-16.04" linux-x64 |
| 65 | + - run: |
| 66 | + tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C |
| 67 | + "prebuilds/windows-latest" win32-ia32 |
| 68 | + - run: |
| 69 | + tar -cvf "${{ steps.get_version.outputs.version }}-win32-x64.tar" -C |
| 70 | + "prebuilds/windows-latest" win32-x64 |
| 71 | + - uses: softprops/action-gh-release@v1 |
| 72 | + with: |
| 73 | + files: ${{ steps.get_version.outputs.version }}-*.tar |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments