Skip to content

Commit

Permalink
refactor: update the outdated workflows and use node 16 (#138)
Browse files Browse the repository at this point in the history
* refactor: update the outdated workflows and use node 16

* refactor: naming tweak
  • Loading branch information
byCedric authored Jan 11, 2022
1 parent 3bf9181 commit 3134e26
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 87 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/ci.yml

This file was deleted.

56 changes: 24 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
---
name: Release
name: release

on:
workflow_dispatch:
inputs:
release:
description: 'type "release" to confirm creating a new release (main branch only)'
description: 'type "release" to create the release (main branch only)'
required: false

concurrency:
group: release
cancel-in-progress: true

env:
release: ${{ github.ref == 'refs/heads/main' && github.event.inputs.release == 'release' }}

jobs:
release:
name: Release version
runs-on: ubuntu-latest
steps:
- name: Setup repo
- name: 🏗 Setup repo
uses: actions/checkout@v2
- name: Setup node

- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Find cache
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore cache
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
node-version: 16.x
cache: yarn

- name: 📦 Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Lint package
run: yarn lint
- name: Test package
run: yarn test
- name: Build clean
run: yarn clean
- name: Build package
run: yarn build
- name: Build up-to-date
run: git diff --stat --exit-code build
- name: Test-run release
if: success() && github.event.inputs.release != 'release'

- name: 📋 Dry-running release
if: ${{ !env.release }}
run: yarn semantic-release --dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: success() && github.event.inputs.release == 'release' && github.ref == 'refs/heads/main'

- name: 📋 Release code
if: ${{ env.release }}
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: review

on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]

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

jobs:
build:
strategy:
matrix:
node: [16.x]
os:
- macos-latest
- ubuntu-latest
- windows-latest
include:
- node: 16.x
os: ubuntu-latest
checkBuild: true
runs-on: ${{ matrix.os }}
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2

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

- name: 📦 Install dependencies
run: yarn install --frozen-lockfile --check-files

- name: ✅ Lint code
run: yarn lint

- name: 🧪 Test code
run: yarn test

- name: 👷 Build code
run: yarn build

- name: 🕵️ Validate code
if: ${{ matrix.checkBuild }}
run: |
echo "⚠️ If this step fails, the build is outdated."
echo " > run 'yarn build' and commit changes"
git diff --stat --exit-code build

0 comments on commit 3134e26

Please sign in to comment.