diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6aa7f98..08b2210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,22 +3,21 @@ name: ci on: push: branches: - - main - pull_request: - types: [opened, synchronize, reopened] + - 'main' + pull_request: {} jobs: build_test_release: strategy: matrix: - os: [ubuntu-latest, windows-latest] - node-version: [12, 14, 16] + node-version: ${{ fromJSON(github.ref == 'refs/heads/main' && '[16]' || '[12,14,16]') }} + os: ${{ fromJSON(github.ref == 'refs/heads/main' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest"]') }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: use Node.js ${{ matrix.node-version }} on ${{ matrix.os }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - name: install @@ -26,10 +25,10 @@ jobs: - name: build run: npm run build - name: test - run: npm run test - # - name: Release - # if: github.repository == 'timdeschryver/ngrx-immer' && github.ref == 'refs/heads/main' && matrix.node-version == 16 && matrix.os == 'ubuntu-latest' - # run: npx semantic-release - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm run test -- --ci --coverage + - name: Release + if: github.repository == 'timdeschryver/ngrx-immer' && github.ref == 'refs/heads/main' + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file