Skip to content

Commit

Permalink
chore: add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Sep 5, 2024
1 parent daa475e commit 4c61de9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 25 deletions.
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:
uses: adonisjs/core/.github/workflows/test.yml@main
Expand Down
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 }}
57 changes: 32 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"@japa/expect-type": "^2.0.2",
"@japa/file-system": "^2.3.0",
"@japa/runner": "^3.1.4",
"@release-it/conventional-changelog": "^8.0.1",
"@swc/core": "^1.7.23",
"@types/node": "^22.5.4",
"@types/pretty-hrtime": "^1.0.3",
Expand Down Expand Up @@ -189,44 +190,50 @@
"framework",
"mvc"
],
"eslintConfig": {
"extends": "@adonisjs/eslint-config/package"
"publishConfig": {
"provenance": true,
"access": "public"
},
"c8": {
"reporter": [
"text",
"html"
],
"exclude": [
"tests/**",
"build/**",
"factories/**",
".yalc/**"
]
},
"prettier": "@adonisjs/prettier-config",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"publishConfig": {
"access": "public",
"tag": "latest"
},
"release-it": {
"git": {
"requireCleanWorkingDir": true,
"requireUpstream": true,
"commitMessage": "chore(release): ${version}",
"tagAnnotation": "v${version}",
"push": true,
"tagName": "v${version}"
},
"hooks": {
"after:init": "npm test"
},
"github": {
"release": true,
"releaseName": "v${version}",
"web": true
"release": true
},
"npm": {
"publish": true,
"skipChecks": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "angular"
}
}
}
},
"c8": {
"reporter": [
"text",
"html"
],
"exclude": [
"tests/**",
"build/**",
"factories/**",
".yalc/**"
]
}
"prettier": "@adonisjs/prettier-config"
}

0 comments on commit 4c61de9

Please sign in to comment.