Skip to content

Commit

Permalink
ci(ethers): add multiple release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Feb 22, 2023
1 parent fe2e9b0 commit 10b6499
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release

on:
push:
branches:
- main
- ethers-v5
- ethers-v6

jobs:
test:
uses: rubilmax/ethers-maths/.github/workflows/test.yml@main

release:
needs: test

uses: rubilmax/ethers-maths/.github/workflows/release.yml@main
secrets: inherit
23 changes: 10 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
name: Publish package release
name: Release

on:
workflow_call:
inputs:
node-version:
type: string
default: lts/*
secrets:
NPM_TOKEN:
required: true
workflow_run:
workflows: ["Jest Test Suite"]
branches: [main]
types:
- completed

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
semantic-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
- name: Setup Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version: ${{ inputs.node-version }}
cache: yarn

- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile

- name: Build package
run: yarn build
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/jest.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: Jest Test Suite

on:
push:
branches:
- main
pull_request:
paths:
- src/**
- test/**
- package.json
- yarn.lock
workflow_call:

jobs:
build:
jest:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile

- name: Run Jest test suite
run: yarn test
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
},
"release": {
"branches": [
"main"
"main",
"ethers-v5",
"ethers-v6"
],
"plugins": [
[
Expand Down

0 comments on commit 10b6499

Please sign in to comment.