Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat: Add TypeScript Action (#83)
cf. https://github.com/peaceiris/actions-github-pages Close #54
- Loading branch information
Shohei Ueda
authored and
GitHub
committed
Feb 5, 2020
1 parent
28b05fd
commit 68b21c1
Showing
39 changed files
with
9,269 additions
and
241 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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
version: 1 | ||
update_configs: | ||
- package_manager: "docker" | ||
- package_manager: "javascript" | ||
directory: "/" | ||
update_schedule: "daily" | ||
default_labels: | ||
- "dependencies" | ||
- "docker" | ||
commit_message: | ||
prefix: "deps" |
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,7 +1,2 @@ | ||
.git | ||
.github | ||
.hadolint.yaml | ||
LICENSE | ||
README.md | ||
action.yml | ||
images | ||
.* | ||
* |
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,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[Makefile] | ||
indent_size = 4 | ||
indent_style = tab |
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,3 @@ | ||
nvmrc=~/.nvm/nvm.sh | ||
source $nvmrc | ||
nvm use |
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,24 @@ | ||
{ | ||
"env": { | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jest/recommended" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"sourceType": "module", | ||
"ecmaVersion": 2019 | ||
}, | ||
"rules": { | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v3.*.*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
run: echo "${GITHUB_CONTEXT}" | ||
|
||
- name: Install github/hub | ||
run: | | ||
export HUB_VERSION="2.14.1" | ||
curl -fsSL https://github.com/github/hub/raw/40e421edd2c63d57bb8daa4bb9bbdfa21e8becf9/script/get | bash -s "${HUB_VERSION}" | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
TAG_NAME="${GITHUB_REF##refs/tags/}" | ||
echo "See [CHANGELOG.md](https://github.com/${GITHUB_REPOSITORY}/blob/${TAG_NAME}/CHANGELOG.md) for more details." > ./release_notes.md | ||
RELEASE_NAME="$(jq -r '.name' ./package.json)" | ||
sed -i "1i${RELEASE_NAME} ${TAG_NAME}\n" ./release_notes.md | ||
./bin/hub release create \ | ||
--draft \ | ||
--prerelease \ | ||
--file ./release_notes.md \ | ||
"${TAG_NAME}" |
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,86 @@ | ||
name: Test Action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '*.md' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
paths-ignore: | ||
- '*.md' | ||
|
||
jobs: | ||
skipci: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}" | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
if: contains(github.event.head_commit.message, '[skip ci]') == false | ||
strategy: | ||
matrix: | ||
os: | ||
- 'ubuntu-18.04' | ||
# - 'macos-latest' | ||
# - 'windows-latest' | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Read .nvmrc | ||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)" | ||
id: nvm | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
|
||
- run: npm ci | ||
- run: npm run build | ||
|
||
- name: Setup mdBook | ||
uses: peaceiris/actions-mdbook@v1 | ||
with: | ||
mdbook-version: '0.3.5' | ||
|
||
- name: Build | ||
working-directory: ./test_projects/mdbook | ||
run: mdbook build | ||
|
||
- name: Prepare tag | ||
id: prepare_tag | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
TAG_NAME="${GITHUB_REF##refs/tags/}" | ||
echo "::set-output name=tag_name::${TAG_NAME}" | ||
echo "::set-output name=deploy_tag_name::deploy-${TAG_NAME}" | ||
- name: Deploy | ||
uses: ./ | ||
with: | ||
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# publish_branch: master | ||
publish_dir: ./test_projects/mdbook/book | ||
# external_repository: '' | ||
allow_empty_commit: true | ||
# keep_files: true | ||
force_orphan: true | ||
# user_name: iris | ||
# user_email: email@peaceiris.com | ||
# commit_message: ${{ github.event.head_commit.message }} | ||
# tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }} | ||
# tag_message: 'Deployment ${{ steps.prepare_tag.outputs.tag_name }}' | ||
|
||
# - name: Deploy v2 | ||
# uses: peaceiris/actions-gh-pages@v2 | ||
# env: | ||
# ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
# PUBLISH_BRANCH: gh-pages | ||
# PUBLISH_DIR: ./test_projects/mdbook/book |
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,64 @@ | ||
name: 'Test' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '*.md' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
paths-ignore: | ||
- '*.md' | ||
|
||
jobs: | ||
skipci: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- run: echo "[Skip CI] ${{ contains(github.event.head_commit.message, '[skip ci]') }}" | ||
|
||
test: | ||
runs-on: ${{ matrix.os }} | ||
if: contains(github.event.head_commit.message, '[skip ci]') == false | ||
strategy: | ||
matrix: | ||
os: | ||
- 'ubuntu-18.04' | ||
- 'macos-latest' | ||
- 'windows-latest' | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Read .nvmrc | ||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)" | ||
id: nvm | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
|
||
- run: npm ci | ||
|
||
- name: Run prettier | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: npm run format:check | ||
|
||
- name: Run eslint | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: npm run lint | ||
|
||
- name: Run ncc | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: npm run build | ||
|
||
- run: npm test | ||
|
||
- name: Upload test coverage as artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: coverage | ||
path: coverage |
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
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 +1,6 @@ | ||
.DS_Store | ||
coverage | ||
.npm | ||
.eslintcache | ||
.env | ||
node_modules |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
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 @@ | ||
12.14.1 |
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,11 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"bracketSpacing": false, | ||
"arrowParens": "avoid", | ||
"parser": "typescript" | ||
} |
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,3 @@ | ||
{ | ||
"git.ignoreLimitWarning": true | ||
} |
Oops, something went wrong.