Skip to content

Commit

Permalink
Merge pull request #205 from pplancq/feature/actionPublish
Browse files Browse the repository at this point in the history
  • Loading branch information
bencompton committed Mar 26, 2024
2 parents 1c8c510 + 2d85ea9 commit f51af8d
Show file tree
Hide file tree
Showing 9 changed files with 9,203 additions and 3,778 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/"
schedule:
interval: "monthly"
labels:
- 'dependencies'
open-pull-requests-limit: 10
target-branch: 'master'
43 changes: 34 additions & 9 deletions .github/workflows/run-tests.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,43 @@
name: Tests
name: Build

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened

env:
HUSKY: 0 # for disable husky on ci

jobs:
commitlint:
if: github.event_name == 'pull_request'
name: CommitLint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node v20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

# https://docs.npmjs.com/cli/v10/commands/npm-ci
- name: Install Package
run: npm ci

# https://commitlint.js.org/guides/ci-setup.html#github-actions
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose --color

build:
name: Build
runs-on: ubuntu-latest
Expand All @@ -17,8 +49,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Testing with Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -34,11 +64,6 @@ jobs:
- name: Install Package
run: npm ci

# https://commitlint.js.org/guides/ci-setup.html#github-actions
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose --color

- name: Run Lint
run: npm run lint

Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/npm-publish.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
workflow_dispatch:

permissions:
contents: read

env:
HUSKY: 0 # for disable husky on ci

jobs:
release:
if: github.event_name == 'workflow_dispatch'
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node v20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

# https://docs.npmjs.com/cli/v10/commands/npm-ci
- name: Install Package
run: npm ci

- name: Build Project
run: npm run build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.JEST_CUCUMBER_NPM_TOKEN }}
GIT_AUTHOR_EMAIL: release[bot]@users.noreply.github.com
GIT_AUTHOR_NAME: release[bot]
GIT_COMMITTER_EMAIL: release[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: release[bot]
run: npm run release
27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Close stale issues and PRs'

on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write

steps:
- uses: actions/stale@v9
with:
days-before-stale: 60
days-before-close: 7
# issue
exempt-issue-labels: 'enhancement,bug,needs examples,needs documentation,work-in-progress'
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
close-issue-message: 'This issue is closed because there has been no recent activity.'
# pr
exempt-pr-labels: 'dependencies,enhancement,bug,needs examples,needs documentation,work-in-progress'
stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
close-pr-message: 'This PR is closed because there has been no recent activity.'
exempt-draft-pr: true
16 changes: 13 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
.github/
.husky/
.vscode/
coverage/
docs/
examples/
src/
images/
.vscode/
tsconfig.json
specs/
src/
.editorconfig
.gitattributes
.tool-versions
CODE_OF_CONDUCT.md
CONTRIBUTING.md
tsconfig.json

0 comments on commit f51af8d

Please sign in to comment.