Skip to content

Commit

Permalink
chore: setup CI based releases
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Sep 14, 2024
1 parent 5a66faa commit 7c54228
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 236 deletions.
170 changes: 0 additions & 170 deletions .github/labels.json

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: checks
on:
- push
- pull_request
- workflow_call

jobs:
test:
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Sync labels
on:
workflow_dispatch:
permissions:
issues: write
jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EndBug/label-sync@v2
with:
config-file: 'https://raw.githubusercontent.com/thetutlage/static/main/labels.yml'
delete-other-labels: true
token: ${{ secrets.GITHUB_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: release
on: workflow_dispatch
permissions:
contents: write
id-token: write
jobs:
checks:
uses: ./.github/workflows/checks.yml
release:
needs: checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Init npm config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: npm install
- run: npm run release -- --ci
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { configPkg } from '@adonisjs/eslint-config'
export default configPkg()
124 changes: 63 additions & 61 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,84 +19,52 @@
"scripts": {
"pretest": "npm run lint",
"test": "c8 npm run quick:test",
"clean": "del-cli build",
"lint": "eslint",
"format": "prettier --write .",
"typecheck": "tsc --noEmit",
"precompile": "npm run lint && npm run clean",
"precompile": "npm run lint",
"compile": "tsup-node && tsc --emitDeclarationOnly --declaration",
"build": "npm run compile",
"release": "np",
"version": "npm run build",
"format": "prettier --write .",
"prepublishOnly": "npm run build",
"lint": "eslint . --ext=.ts",
"sync-labels": "github-label-sync --labels .github/labels.json poppinss/hooks",
"quick:test": "cross-env NODE_DEBUG=poppinss:hooks node --loader=ts-node/esm bin/test.ts"
"release": "release-it",
"quick:test": "cross-env NODE_DEBUG=poppinss:hooks node --import=ts-node-maintained/register/esm --enable-source-maps bin/test.ts"
},
"keywords": [
"hooks",
"poppinss"
],
"author": "virk,poppinss",
"license": "MIT",
"devDependencies": {
"@adonisjs/eslint-config": "^1.3.0",
"@adonisjs/prettier-config": "^1.3.0",
"@adonisjs/tsconfig": "^1.3.0",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@japa/assert": "^2.1.0",
"@japa/expect-type": "^2.0.1",
"@japa/runner": "^3.1.1",
"@swc/core": "^1.4.11",
"@types/node": "^20.11.30",
"c8": "^9.1.0",
"@adonisjs/eslint-config": "^2.0.0-beta.6",
"@adonisjs/prettier-config": "^1.4.0",
"@adonisjs/tsconfig": "^1.4.0",
"@japa/assert": "^3.0.0",
"@japa/expect-type": "^2.0.2",
"@japa/runner": "^3.1.4",
"@swc/core": "^1.7.26",
"@types/node": "^22.5.5",
"c8": "^10.1.2",
"cross-env": "^7.0.3",
"del-cli": "^5.1.0",
"eslint": "^8.57.0",
"github-label-sync": "^2.3.1",
"husky": "^9.0.11",
"np": "^10.0.2",
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"tsup": "^8.0.2",
"typescript": "^5.4.3"
"eslint": "^9.10.0",
"np": "^10.0.7",
"prettier": "^3.3.3",
"ts-node-maintained": "^10.9.4",
"tsup": "^8.2.4",
"typescript": "^5.6.2"
},
"homepage": "https://github.com/poppinss/hooks#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/poppinss/hooks.git"
},
"bugs": {
"url": "https://github.com/poppinss/hooks/issues"
},
"homepage": "https://github.com/poppinss/hooks#readme",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"keywords": [
"hooks",
"poppinss"
],
"author": "virk,poppinss",
"license": "MIT",
"publishConfig": {
"access": "public",
"tag": "latest"
},
"np": {
"message": "chore(release): %s",
"tag": "latest",
"branch": "main",
"anyBranch": false
},
"c8": {
"reporter": [
"text",
"html"
],
"exclude": [
"tests/**"
]
"provenance": true
},
"eslintConfig": {
"extends": "@adonisjs/eslint-config/package"
},
"prettier": "@adonisjs/prettier-config",
"tsup": {
"entry": [
"./index.ts",
Expand All @@ -108,5 +76,39 @@
"dts": false,
"sourcemap": true,
"target": "esnext"
}
},
"release-it": {
"git": {
"requireCleanWorkingDir": true,
"requireUpstream": true,
"commitMessage": "chore(release): ${version}",
"tagAnnotation": "v${version}",
"push": true,
"tagName": "v${version}"
},
"github": {
"release": true
},
"npm": {
"publish": true,
"skipChecks": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "angular"
}
}
}
},
"c8": {
"reporter": [
"text",
"html"
],
"exclude": [
"tests/**"
]
},
"prettier": "@adonisjs/prettier-config"
}

0 comments on commit 7c54228

Please sign in to comment.