-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add ci & release actions files #166
- Loading branch information
Showing
2 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
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,76 @@ | ||
# ./github/workflows/ci.yml | ||
# Excute lint and build. | ||
|
||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
env: | ||
NODE_VERSION: 16.x | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- uses: actions/cache@v2 | ||
id: node-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Install dependencies | ||
if: steps.node-cache.outputs.cache-hit != 'true' | ||
run: npm ci --ignore-scripts | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
needs: [install, release] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Run linters | ||
uses: wearerequired/lint-action@v1 | ||
with: | ||
git_email: 'woorimprog@gmail.com' | ||
auto_fix: true | ||
commit_message: 'style: fix code style issues with ${linter}' | ||
eslint: true | ||
eslint_extensions: 'js,jsx,ts,tsx' | ||
prettier: true | ||
prettier_extensions: 'js,jsx,ts,tsx,css,html,scss' | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [install] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Build | ||
run: npm run build | ||
|
||
# test: | ||
# runs-on: ubuntu-latest | ||
# needs: [install] | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: actions/cache@v2 | ||
# with: | ||
# path: "**/node_modules" | ||
# key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
# - name: Test | ||
# run: npm test |
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,47 @@ | ||
# ./github/workflows/release-to-npm.yml | ||
# Excute release to npm. | ||
|
||
name: Release to NPM | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
env: | ||
NODE_VERSION: 16.x | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- uses: actions/cache@v2 | ||
id: node-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Install dependencies | ||
if: steps.node-cache.outputs.cache-hit != 'true' | ||
run: npm ci --ignore-scripts | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
needs: [install] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-modules-${{ hashFiles('**/package-lock.json') }} | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npx semantic-release |