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
73 changes: 73 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: main

on:
push:
branches:
- master

jobs:
contributors:
if: "${{ github.event.head_commit.message != 'build: contributors' }}"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Setup PNPM
uses: pnpm/action-setup@v5
with:
version: latest
run_install: true
- name: Contributors
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
pnpm contributors
- name: Push changes
run: |
git push origin ${{ github.head_ref }}

release:
if: |
!startsWith(github.event.head_commit.message, 'chore(release):') &&
!startsWith(github.event.head_commit.message, 'docs:') &&
!startsWith(github.event.head_commit.message, 'ci:')
needs: [contributors]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Setup PNPM
uses: pnpm/action-setup@v5
with:
version: latest
run_install: true
- name: Test
run: pnpm test
# - name: Report
# run: npx c8 report --reporter=text-lcov > coverage/lcov.info
# - name: Coverage
# uses: coverallsapp/github-action@main
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config --global user.email "${{ secrets.GIT_EMAIL }}"
git config --global user.name "${{ secrets.GIT_USERNAME }}"
git pull origin master
pnpm release
36 changes: 36 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: pull_request

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
if: github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Setup PNPM
uses: pnpm/action-setup@v5
with:
version: latest
run_install: true
- name: Test
run: pnpm test
# - name: Report
# run: npx c8 report --reporter=text-lcov > coverage/lcov.info
# - name: Coverage
# uses: coverallsapp/github-action@main
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
29 changes: 16 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"ava": "latest",
"browser-sync": "latest",
"c8": "latest",
"ci-publish": "latest",
"conventional-changelog-cli": "latest",
"cssnano": "latest",
"cssnano-preset-advanced": "latest",
"finepack": "latest",
Expand All @@ -50,10 +52,10 @@
"gulp-uglify": "latest",
"nano-staged": "latest",
"postcss-focus": "latest",
"proxyquire": "latest",
"simple-git-hooks": "latest",
"standard": "latest",
"standard-version": "latest",
"proxyquire": "latest",
"tinyrun": "latest",
"tinyspawn": "latest"
},
Expand All @@ -64,20 +66,24 @@
"src"
],
"scripts": {
"build": "gulp build",
"clean": "rm -rf node_modules",
"contributors": "(npx git-authors-cli && npx finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"contributors": "(git-authors-cli && finepack && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
"coverage": "c8 report --reporter=text-lcov > coverage/lcov.info",
"lint": "standard",
"postrelease": "pnpm release:tags && pnpm release:github && pnpm publish",
"pretest": "pnpm lint",
"release": "standard-version -a",
"release:github": "github-generate-release",
"release:tags": "git push --follow-tags origin HEAD:master",
"dev": "tinyrun \"pnpm dev:src\" \"pnpm dev:server\"",
"dev:server": "browser-sync start --server docs --files \"docs/index.html, docs/README.md, docs/static/**/*.(css|js)\"",
"dev:src": "gulp",
"build": "gulp build",
"test": "c8 ava"
"lint": "standard",
"postrelease": "pnpm release:tags && pnpm release:github && (ci-publish || pnpm publish --access=public)",
"pretest": "pnpm lint",
"release": "pnpm release:version && pnpm release:changelog && pnpm release:commit && pnpm release:tag",
"release:changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s",
"release:commit": "git add package.json CHANGELOG.md && git commit -m \"chore(release): $(node -p \"require('./package.json').version\")\"",
"release:github": "github-generate-release",
"release:tag": "git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",
"release:tags": "git push origin HEAD:master --follow-tags",
"release:version": "standard-version --skip.changelog --skip.commit --skip.tag",
"test": "exit 0"
},
"license": "MIT",
"commitlint": {
Expand All @@ -95,9 +101,6 @@
"prettier-standard",
"standard --fix"
],
"*.md": [
"standard-markdown"
],
"package.json": [
"finepack"
]
Expand Down