-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update the outdated workflows and use node 16 (#138)
* refactor: update the outdated workflows and use node 16 * refactor: naming tweak
- Loading branch information
Showing
3 changed files
with
78 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |