Skip to content
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
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<!-- Detail of changes (please add screenshots if applicable) -->
<!-- ビューの変更がある場合はスクショによる比較などがあるとわかりやすい -->

<!-- START pr-commits -->
<!-- END pr-commits -->

## Expected Impact: 影響範囲
<!-- e.g. I changed this function, which might be affect that function. -->
<!-- この関数を変更したのでこの機能にも影響がある、など -->
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/add-version-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ on:
name: Add version tag

jobs:
release:
tag:
name: Add version tag
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v')
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Get version
run: echo "::set-env name=TAG_NAME::${HEAD_REF#release/}"
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/check-version.yml

This file was deleted.

36 changes: 23 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,57 +141,67 @@ jobs:
matrix:
target: ['npm']
steps:
- name: Set running flag
run: echo "::set-env name=RUNNING::1"
- name: Set running flag
run: |
if [ -z "$NPM_AUTH_TOKEN" ]; then
echo "::set-env name=RUNNING::"
fi
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- uses: actions/checkout@v2
if: env.RUNNING
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
if: matrix.target == 'npm'
if: env.RUNNING && matrix.target == 'npm'
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com
if: matrix.target == 'gpr'
if: env.RUNNING && matrix.target == 'gpr'
- name: Get Yarn Cache Directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
if: env.RUNNING
- name: Cache node dependencies
uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

if: env.RUNNING
- name: Check package version
uses: technote-space/package-version-check-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_DISABLED: 1
if: env.RUNNING
- name: Install Package dependencies
run: yarn install
if: env.RUNNING
- name: Build
run: yarn build
if: env.RUNNING
- name: Publish
run: |
if [ -n "$NPM_AUTH_TOKEN" ]; then
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish
fi
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: matrix.target == 'npm'
if: env.RUNNING && matrix.target == 'npm'
- name: Publish
run: |
if [ -n "$NPM_AUTH_TOKEN" ]; then
npm publish
fi
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
if: matrix.target == 'gpr'
if: env.RUNNING && matrix.target == 'gpr'
- uses: 8398a7/action-slack@v2
with:
status: failure
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-opened.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,24 @@ jobs:
uses: technote-space/pr-labeler-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

checkVersion:
name: Check package version
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Set running flag
run: echo "::set-env name=RUNNING::1"
- uses: actions/checkout@v2
- name: Set running flag
run: |
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
echo "::set-env name=RUNNING::"
fi

- name: Check package version
uses: technote-space/package-version-check-action@v1
with:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH_PREFIX: release/
if: env.RUNNING
49 changes: 47 additions & 2 deletions .github/workflows/pr-updated.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
on: pull_request
on:
pull_request:
types: [opened, synchronize]

name: Pull Request updated

jobs:
triage:
name: Pull Request Labeler
runs-on: ubuntu-latest
if: "! startsWith(github.event.pull_request.head.ref, 'release/v')"
if: "! startsWith(github.event.pull_request.head.ref, 'release/')"
steps:
- name: Pull Request Labeler
uses: actions/labeler@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

history:
name: Pull Request Body
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Pull Request Body
uses: technote-space/pr-commit-body-action@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXCLUDE_MESSAGES: |
trigger workflow
Update TOC
Update package version

assignToProject:
name: Assign PullRequest to Project
runs-on: ubuntu-latest
if: github.event.action == 'synchronize'
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
Expand All @@ -31,6 +48,7 @@ jobs:
assignAuthor:
name: Assign author to PR
runs-on: ubuntu-latest
if: github.event.action == 'synchronize'
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
Expand All @@ -44,6 +62,7 @@ jobs:
addLabelsByBranch:
name: PR Labeler
runs-on: ubuntu-latest
if: github.event.action == 'synchronize'
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
Expand All @@ -53,3 +72,29 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IGNORE_CONTEXT_CHECK: true

checkVersion:
name: Check package version
runs-on: ubuntu-latest
if: github.event.action == 'synchronize' && startsWith(github.event.pull_request.head.ref, 'release/')
steps:
- name: Set running flag
run: echo "::set-env name=RUNNING::"
- uses: actions/checkout@v2
- uses: technote-space/get-git-comment-action@v1
- name: Set running flag
run: echo "::set-env name=RUNNING::1"
if: contains(env.COMMIT_MESSAGE, 'trigger workflow')
- name: Set running flag
run: |
if [[ ! -f package.json ]] || [[ $(< package.json jq -r '.version == null') == 'true' ]]; then
echo "::set-env name=RUNNING::"
fi

- name: Check package version
uses: technote-space/package-version-check-action@v1
with:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH_PREFIX: release/
IGNORE_CONTEXT_CHECK: true
if: env.RUNNING