Skip to content

Commit

Permalink
fix(release): fix release by creating a new separate step in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Pegase745 committed Jun 30, 2020
1 parent 7a478f0 commit 57feaf8
Showing 1 changed file with 53 additions and 5 deletions.
58 changes: 53 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,73 @@ on:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
Test:
runs-on: '${{ matrix.os }}'

strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v1
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm test

- name: Release package
if: github.ref == 'refs/heads/master'
run: npm run release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Release:
runs-on: ubuntu-latest
needs: Test
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: npm ci
- run: npm run build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'master',
'next',
'next-major',
{
name: 'beta',
prerelease: true
},
{
name: 'alpha',
prerelease: true
}
]
extra_plugins: |
'@semantic-release/changelog'
'@semantic-release/git'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 57feaf8

Please sign in to comment.