mirror of
https://github.com/expo/expo-github-action.git
synced 2026-11-15 17:32:45 -10:00
refactor: update the outdated workflows and use node 16 (#138)
* refactor: update the outdated workflows and use node 16 * refactor: naming tweak
This commit is contained in:
1 parent
3bf9181edb
commit
3134e26b3a
3 files changed
+78
-87
No files matched your search
@@ -1,55 +0,0 @@
|
||||
---
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
jobs:
|
||||
build:
|
||||
name: Test and build
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
node: [14, 16]
|
||||
os:
|
||||
- macos-latest
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
include:
|
||||
- node: 14
|
||||
os: ubuntu-latest
|
||||
checkUpToDate: true
|
||||
steps:
|
||||
- name: Setup repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- name: Find cache
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- name: Restore cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-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
|
||||
if: ${{ matrix.checkUpToDate }}
|
||||
run: |
|
||||
echo "⚠️ If this step fails, the build is outdated."
|
||||
echo " > run 'yarn build' and commit changes"
|
||||
git diff --stat --exit-code build
|
||||
@@ -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 }}
|
||||
@@ -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
|
||||
Reference in new issue
Block a user