Skip to content

Commit 0b925df

Browse files
committed
ci: use one workflow
1 parent 1c55766 commit 0b925df

File tree

2 files changed

+16
-37
lines changed

2 files changed

+16
-37
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
name: ci
22

3-
on: pull_request
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request: {}
48

59
jobs:
6-
build_and_test:
10+
build_test_release:
711
strategy:
812
matrix:
9-
os: [ubuntu-latest, windows-latest]
10-
node: [12, 14, 16]
13+
node-version: ${{ fromJSON(github.ref == 'refs/heads/main' && '[16]' || '[12,14,16]') }}
14+
os: ${{ fromJSON(github.ref == 'refs/heads/main' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest"]') }}
1115
runs-on: ${{ matrix.os }}
16+
1217
steps:
1318
- uses: actions/checkout@v2
14-
- name: use Node.js ${{ matrix.node-version }}
19+
- name: use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
1520
uses: actions/setup-node@v2
1621
with:
1722
node-version: ${{ matrix.node-version }}
@@ -21,3 +26,9 @@ jobs:
2126
run: npm run build -- --skip-nx-cache
2227
- name: test
2328
run: npm run test -- --ci --code-coverage
29+
- name: Release
30+
if: github.repository == 'testing-library/angular-testing-library' && github.ref == 'refs/heads/main'
31+
run: npx semantic-release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)