Skip to content

Commit 595fa24

Browse files
committed
fix: CI: move release to test.yaml and rename to ci.yml
So that a release is made only if tests pass.
1 parent f182279 commit 595fa24

File tree

3 files changed

+29
-40
lines changed

3 files changed

+29
-40
lines changed
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: CI
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
FORCE_COLOR: 2
12-
NODE_LINT: 18
12+
NODE: 18
1313

1414
jobs:
1515
lint:
@@ -23,7 +23,7 @@ jobs:
2323

2424
- uses: actions/setup-node@v3
2525
with:
26-
node-version: '${{ env.NODE_LINT }}'
26+
node-version: '${{ env.NODE }}'
2727
cache: npm
2828

2929
- run: npm ci
@@ -54,3 +54,28 @@ jobs:
5454
- run: npm ci
5555
- run: npm run build
5656
- run: npm test
57+
58+
release:
59+
if: github.repository == 'twbs/fantasticon'
60+
name: Release
61+
runs-on: ubuntu-latest
62+
needs: [lint, test]
63+
64+
steps:
65+
- uses: actions/checkout@v3
66+
with:
67+
fetch-depth: 0
68+
persist-credentials: false
69+
- uses: actions/setup-node@v3
70+
with:
71+
node-version: '${{ env.NODE }}'
72+
cache: npm
73+
- name: Install dependencies
74+
run: npm ci
75+
- name: Build
76+
run: npm run build
77+
- name: Release
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
81+
run: npx semantic-release --branches dev

.github/workflows/release.yaml

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

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
</blockquote>
1010

1111
<p align="center">
12-
<img src="https://github.com/twbs/fantasticon/workflows/Test/badge.svg" alt="Test status">
13-
<img src="https://github.com/twbs/fantasticon/workflows/Release/badge.svg" alt="Release status">
12+
<img src="https://github.com/twbs/fantasticon/actions/workflows/ci.yml/badge.svg" alt="CI status">
1413
</p>
1514

1615
### Intro

0 commit comments

Comments
 (0)