From 595fa242fee22638bcdf6eac7362d7b270cba62d Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 25 Mar 2023 16:24:05 +0200 Subject: [PATCH] fix: CI: move release to test.yaml and rename to ci.yml So that a release is made only if tests pass. --- .github/workflows/{test.yaml => ci.yml} | 31 +++++++++++++++++++--- .github/workflows/release.yaml | 35 ------------------------- README.md | 3 +-- 3 files changed, 29 insertions(+), 40 deletions(-) rename .github/workflows/{test.yaml => ci.yml} (56%) delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/ci.yml similarity index 56% rename from .github/workflows/test.yaml rename to .github/workflows/ci.yml index 109e604..1d117ff 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: CI on: push: @@ -9,7 +9,7 @@ on: env: FORCE_COLOR: 2 - NODE_LINT: 18 + NODE: 18 jobs: lint: @@ -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 @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index c77acb0..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Release - -on: - push: - branches: [dev] - workflow_dispatch: - -env: - FORCE_COLOR: 2 - NODE: 18 - -jobs: - release: - if: github.repository == 'twbs/fantasticon' - name: Release - runs-on: ubuntu-latest - - 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 diff --git a/README.md b/README.md index cb8e03f..bc272b6 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@

- Test status - Release status + CI status

### Intro