Skip to content

Merge pull request #34 from tabcat/release-please--branches--master--… #51

Merge pull request #34 from tabcat/release-please--branches--master--…

Merge pull request #34 from tabcat/release-please--branches--master--… #51

Workflow file for this run

name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci
- run: npm run lint
test-node:
if: github.event.pull_request.draft == false
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # [windows-latest, ubuntu-latest, macos-latest]
node: [18]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- run: npm ci
- run: npm run test:node
- uses: codecov/codecov-action@v3
with:
flags: node
# test-chrome:
# if: github.event.pull_request.draft == false
# needs: check
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest] # [windows-latest, ubuntu-latest, macos-latest]
# node: [18]
# fail-fast: true
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# cache: 'npm'
# - run: npm ci
# - run: npm run test:chrome
# - uses: codecov/codecov-action@v3
# with:
# flags: node
release:
runs-on: ubuntu-latest
# needs: [test-node, test-chrome]
needs: test-node
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.event.pull_request.draft == false
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npx aegir docs --publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The logic below handles the npm publication:
# these if statements ensure that a publication only occurs when
# a new release is created:
- run: npm publish
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: |
npm version `node -p -e "require('./package.json').version"`-`git rev-parse --short HEAD` --no-git-tag-version
npm publish --tag next --access public
if: ${{ !steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
name: release rc