-
Notifications
You must be signed in to change notification settings - Fork 75
44 lines (43 loc) · 1.25 KB
/
test_and_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Test & Release
on: [push, pull_request]
env:
CI: false
jobs:
tests:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '16', '18' ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: yarn install --frozen-lockfile
working-directory: ./next-cloudinary
- run: yarn test
working-directory: ./next-cloudinary
- run: yarn test:app
working-directory: ./next-cloudinary
release:
name: Release
if: github.event_name == 'push' && github.ref_name == 'main'
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: yarn install --frozen-lockfile
# Semantic Release is incompatible with node 16 - so add these only on release
- run: yarn add @semantic-release/changelog @semantic-release/git semantic-release -W
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --branches main