Skip to content

Commit

Permalink
fix: CI: move release to test.yaml and rename to ci.yml
Browse files Browse the repository at this point in the history
So that a release is made only if tests pass.
  • Loading branch information
XhmikosR committed Mar 25, 2023
1 parent f182279 commit 595fa24
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 40 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/test.yaml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: CI

on:
push:
Expand All @@ -9,7 +9,7 @@ on:

env:
FORCE_COLOR: 2
NODE_LINT: 18
NODE: 18

jobs:
lint:
Expand All @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE_LINT }}'
node-version: '${{ env.NODE }}'
cache: npm

- run: npm ci
Expand Down Expand Up @@ -54,3 +54,28 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm test

release:
if: github.repository == 'twbs/fantasticon'
name: Release
runs-on: ubuntu-latest
needs: [lint, test]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: '${{ env.NODE }}'
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release --branches dev
35 changes: 0 additions & 35 deletions .github/workflows/release.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
</blockquote>

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

### Intro
Expand Down

0 comments on commit 595fa24

Please sign in to comment.