Skip to content

Commit

Permalink
fix: update ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sidwebworks committed Jun 13, 2022
1 parent 2589f9a commit 6c96b91
Showing 1 changed file with 14 additions and 36 deletions.
50 changes: 14 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Node.js CI

on:
push:
Expand All @@ -9,32 +9,32 @@ on:
jobs:
test:
if: "!contains(github.event.head_commit.message, 'ci skip')"

strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: 14.x

- name: Cache ~/.pnpm-store
uses: actions/cache@v3
uses: actions/cache@v2
env:
cache-name: cache-pnpm-store
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-test-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-test-
${{ runner.os }}-${{ matrix.node-version }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-build-
${{ runner.os }}-
- name: Install pnpm
run: npm i -g pnpm
Expand All @@ -44,32 +44,10 @@ jobs:

# Runs a set of commands using the runners shell
- name: Build and Test
run: pnpm test
run: npm run test

release:
runs-on: ubuntu-latest
needs: ['test']
if: "!contains(github.event.head_commit.message, 'initial commit')"
if: "!contains(github.event.head_commit.message, 'skip-release') && !contains(github.event.head_commit.message, 'skip-ci') && github.event_name != 'pull_request'"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache ~/.pnpm-store
uses: actions/cache@v3
env:
cache-name: cache-pnpm-store
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-release-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.node-version }}-release-
${{ runner.os }}-
- run: npm i -g pnpm
- run: pnpm i
- run: pnpx semantic-release --branches main
- name: Release
run: pnpx -y semantic-release --branches main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 6c96b91

Please sign in to comment.