From 9783df12ee7c33c1ac72e279b7962edf7a9b497b Mon Sep 17 00:00:00 2001 From: Fuxing Loh <4266087+fuxingloh@users.noreply.github.com> Date: Thu, 12 Nov 2020 17:54:33 +0800 Subject: [PATCH] Triage, CI and Publish GitHub Actions workflow (#38) * Added Triage, CI and Release workflow * Added publish.yml --- .github/PULL_REQUEST_TEMPLATE.md | 3 +++ .github/auto_assign.yml | 7 ++++++ .github/pr-labeler.yml | 3 +++ .github/release-drafter.yml | 34 +++++++++++++++++++++++++++ .github/workflows/ci.yml | 20 ++++++++++++++++ .github/workflows/publish.yml | 28 ++++++++++++++++++++++ .github/workflows/release-drafter.yml | 14 +++++++++++ .github/workflows/triage.yml | 17 ++++++++++++++ 8 files changed, 126 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/auto_assign.yml create mode 100644 .github/pr-labeler.yml create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release-drafter.yml create mode 100644 .github/workflows/triage.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..7284654 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ + diff --git a/.github/auto_assign.yml b/.github/auto_assign.yml new file mode 100644 index 0000000..1a74e26 --- /dev/null +++ b/.github/auto_assign.yml @@ -0,0 +1,7 @@ +addAssignees: author +addReviewers: true + +reviewers: + - fuxingloh + +numberOfReviewers: 1 diff --git a/.github/pr-labeler.yml b/.github/pr-labeler.yml new file mode 100644 index 0000000..14a1810 --- /dev/null +++ b/.github/pr-labeler.yml @@ -0,0 +1,3 @@ +feature: [ 'feature/*', 'feat/*', 'enhancement/*' ] +fix: [ 'fix/*', 'bug/*', 'bugfix/*' ] +chore: [ 'chore/*', 'docs/*' , 'doc/*', 'ci/*' ] diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..69c8c85 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,34 @@ +name-template: 'v$RESOLVED_VERSION 🌈' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + labels: + - 'chore' + - 'docs' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' +version-resolver: + minor: + labels: + - 'feature' + - 'enhancement' + patch: + labels: + - 'patch' + - 'bug' + - 'bugfix' + - 'fix' + default: patch +template: | + ## Changes + + $CHANGES diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0399181 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: + pull_request: + branches: [ master ] + +jobs: + yarn: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '14' + registry-url: 'https://registry.npmjs.org' + + - run: yarn install --frozen-lockfile + - run: yarn build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..07fc7c9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,28 @@ +name: Publish + +on: + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '14' + registry-url: 'https://registry.npmjs.org' + + - run: yarn install --frozen-lockfile + + - name: Check package version + uses: technote-space/package-version-check-action@v1 + with: + COMMIT_MESSAGE: 'release: update package version' + + - run: yarn build + + - run: yarn publish --non-interactive + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..ee7ab2a --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: [ master ] + + +jobs: + draft-release: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml new file mode 100644 index 0000000..89507a5 --- /dev/null +++ b/.github/workflows/triage.yml @@ -0,0 +1,17 @@ +name: "Triage" + +on: + pull_request: + types: [ opened, reopened ] + branches: [ master ] + +jobs: + triage: + name: Triage + runs-on: ubuntu-latest + steps: + - uses: TimonVS/pr-labeler-action@v3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: kentaro-m/auto-assign-action@v1.1.2