Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update the outdated workflows and use node 16 #138

Merged
merged 2 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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