diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d2937b8..d2f6a42 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,37 +3,20 @@ name: CI on: [push, pull_request] jobs: - # Handle [skip ci] / [ci skip] directives in commit messages - init: - if: github.event_name == 'push' - name: init - runs-on: ubuntu-20.04 - outputs: - skip: ${{ steps.ci-skip-step.outputs.ci-skip }} - skip-not: ${{ steps.ci-skip-step.outputs.ci-skip-not }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - id: ci-skip-step - uses: mstachniuk/ci-skip@v1 - # Fast unit tests flow - test_push: + push: if: github.event_name == 'push' - needs: init - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkuout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: ${{ github.ref == 'refs/heads/master' && '0' || '1' }} - name: Setup NodeJS - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 20 - name: Yarn install run: yarn @@ -47,23 +30,33 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Semantic Release + if: github.ref == 'refs/heads/master' + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_PROVENANCE: true + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_AUTHOR_NAME: antongolub@antongolub.com + GIT_AUTHOR_EMAIL: antongolub@antongolub.com + GIT_COMMITTER_NAME: Anton Golub + GIT_COMMITTER_EMAIL: Anton Golub + run: npm_config_yes=true npx zx-semrel + # Full tests for PR test_pr: if: github.event_name == 'pull_request' strategy: matrix: - os: [ windows-2019, ubuntu-20.04 ] - node-version: [ 12, 14, 16 ] + os: [ windows-latest, ubuntu-22.04 ] + node-version: [ 12, 14, 16, 18, 20, 22 ] name: Test (Node v${{ matrix.node-version }}, OS ${{ matrix.os }}) runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + uses: actions/checkout@v4 - name: Setup NodeJS v${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -71,44 +64,9 @@ jobs: run: yarn - name: Intergarion test - if: matrix.node-version != '16' || matrix.os != 'ubuntu-20.04' + if: matrix.node-version != '20' || matrix.os != 'ubuntu-22.04' run: cli/synp.js -s yarn.lock - name: Full test suite - if: matrix.node-version == '16' && matrix.os == 'ubuntu-20.04' + if: matrix.node-version == '20' && matrix.os == 'ubuntu-22.04' run: yarn test - - # Release - release: - name: Release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - runs-on: ubuntu-20.04 - needs: test_push - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup NodeJS - uses: actions/setup-node@v2 - with: - node-version: 16 - - - name: Yarn install - run: yarn - - - name: Semantic Release - uses: cycjimmy/semantic-release-action@v2 - with: - extra_plugins: | - @semantic-release/changelog@6 - @semantic-release/git@10 - @semantic-release/github@8 - @semantic-release/npm@8 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - GIT_AUTHOR_EMAIL: 'mailbox@antongolub.ru' - GIT_COMMITTER_EMAIL: 'mailbox@antongolub.ru' - GIT_AUTHOR_NAME: '@antongolub' - GIT_COMMITTER_NAME: '@antongolub'