Skip to content

Commit

Permalink
chore: update CI workflow and release configuration
Browse files Browse the repository at this point in the history
- Improve the build and release pipeline.
- Added `refresh-token.yml` for token management.
- Added `release.config.js` to customize release settings.
  • Loading branch information
0xjcf committed Dec 15, 2024
1 parent c8bf45c commit d2dc048
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 28 deletions.
25 changes: 1 addition & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 0" # Every Sunday at midnight UTC for token refresh

jobs:
build:
Expand Down Expand Up @@ -52,7 +50,7 @@ jobs:
release:
needs: build
runs-on: ubuntu-22.04

if: ${{ needs.build.result == 'success' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -96,24 +94,3 @@ jobs:
run: |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push origin main --follow-tags
refresh-token:
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Refresh NPM Token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository }}
run: node scripts/refresh-npm-token.js
29 changes: 29 additions & 0 deletions .github/workflows/refresh-token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Refresh NPM Token

on:
schedule:
- cron: "0 0 * * 0" # Every Sunday at midnight UTC

jobs:
refresh-token:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Test refresh token script
run: npm run test:node

- name: Refresh NPM Token
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository }}
run: node scripts/refresh-npm-token.js
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 1.0.13 (2024-12-13)

### 1.0.01 to 1.0.12 (2024-12-13)
### 1.0.01 to 1.0.13 (2024-12-13)

- **Internal updates**:
- Improved publishing steps to avoid duplicate actions.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"test:coverage": "vitest --run --coverage",
"test:node": "FORCE_COLOR=1 vitest --config vitest.node.config.ts --run",
"lint": "eslint .",
"release": "standard-version",
"release": "standard-version --config release.config.js",
"postrelease": "npm publish",
"prepare": "husky"
},
Expand Down
13 changes: 13 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
types: [
{ type: "feat", section: "Features" },
{ type: "fix", section: "Bug Fixes" },
{ type: "docs", section: "Documentation" },
{ type: "refactor", section: "Refactoring" },
{ type: "build", section: "Build System" },
{ type: "ci", section: "Continuous Integration" },
{ type: "chore", section: "Chores", hidden: true },
{ type: "style", section: "Styling", hidden: true },
{ type: "test", section: "Tests", hidden: true },
],
};

0 comments on commit d2dc048

Please sign in to comment.