@@ -0,0 +1,70 @@
|
|||||||
|
name: Release package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev-*
|
||||||
|
- Created_*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
id-token: write
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
token: ${{ steps.app-token.outputs.token }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: latest
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
run_install: false
|
||||||
|
|
||||||
|
- name: Get pnpm store directory
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Setup pnpm cache
|
||||||
|
with:
|
||||||
|
path: ${{ env.STORE_PATH }}
|
||||||
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pnpm-store-
|
||||||
|
|
||||||
|
- name: Update dependencies
|
||||||
|
run: pnpm update
|
||||||
|
|
||||||
|
- name: Format code
|
||||||
|
run: pnpm format
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||||
|
run: pnpm release
|
||||||
|
|
||||||
|
- name: Commit & Push Changes
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
git config --global user.name "gitea-actions"
|
||||||
|
git config --global user.email "actions-user@noreply.git.demonkernel.io.vn"
|
||||||
|
|
||||||
|
git rm -r --cached .
|
||||||
|
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
|
||||||
|
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'
|
||||||
|
git add .
|
||||||
|
git commit -m "chore: release [ci skip]"
|
||||||
|
git push
|
||||||
|
fi
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"importOrder": ["^[./]"],
|
||||||
|
"importOrderSeparation": true,
|
||||||
|
"importOrderSortSpecifiers": true,
|
||||||
|
"proseWrap": "always",
|
||||||
|
"plugins": [
|
||||||
|
"@trivago/prettier-plugin-sort-imports",
|
||||||
|
"prettier-plugin-groovy",
|
||||||
|
"prettier-plugin-embed",
|
||||||
|
"prettier-plugin-tailwindcss"
|
||||||
|
],
|
||||||
|
"importOrderParserPlugins": ["typescript", "decorators-legacy", "jsx"],
|
||||||
|
"embeddedMarkdownComments": ["tw", "tx"],
|
||||||
|
"printWidth": 80,
|
||||||
|
"singleQuote": false,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"useTabs": false,
|
||||||
|
"tailwindAttributes": ["/.*(C|c)lassName/"]
|
||||||
|
}
|
||||||
+12
-1
@@ -6,7 +6,9 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint"
|
"lint": "eslint",
|
||||||
|
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,json,md}\"",
|
||||||
|
"release": "semantic-release"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "16.1.7",
|
"next": "16.1.7",
|
||||||
@@ -15,6 +17,10 @@
|
|||||||
"tailwind": "^4.0.0"
|
"tailwind": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@semantic-release/exec": "^7.1.0",
|
||||||
|
"@semantic-release/github": "^12.0.6",
|
||||||
|
"@semantic-release/npm": "^13.1.5",
|
||||||
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
||||||
"@tailwindcss/postcss": "^4",
|
"@tailwindcss/postcss": "^4",
|
||||||
"@types/node": "^20",
|
"@types/node": "^20",
|
||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
@@ -22,6 +28,11 @@
|
|||||||
"eslint": "^9",
|
"eslint": "^9",
|
||||||
"eslint-config-next": "16.1.7",
|
"eslint-config-next": "16.1.7",
|
||||||
"tailwindcss": "^4",
|
"tailwindcss": "^4",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
|
"prettier-plugin-embed": "^0.5.1",
|
||||||
|
"prettier-plugin-groovy": "^0.2.1",
|
||||||
|
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||||
|
"semantic-release": "^25.0.3",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import type { GlobalConfig } from "semantic-release";
|
||||||
|
|
||||||
|
const config: GlobalConfig = {
|
||||||
|
tagFormat: "v${version}",
|
||||||
|
repositoryUrl: "https://github.com/524H0003/TDTU-auto-login",
|
||||||
|
branches: ["main", { name: "dev-*", prerelease: "dev" }],
|
||||||
|
plugins: [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
["@semantic-release/npm", { npmPublish: false }],
|
||||||
|
[
|
||||||
|
"@semantic-release/exec",
|
||||||
|
{
|
||||||
|
prepareCmd:
|
||||||
|
"pnpm build && node scripts/release.ts ${nextRelease.version}",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"@semantic-release/github",
|
||||||
|
{
|
||||||
|
assets: [
|
||||||
|
{
|
||||||
|
path: "release.zip",
|
||||||
|
name: "TDTU Auto Login v${nextRelease.version}.zip",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
Reference in New Issue
Block a user