Skip to content

Commit 0b8d510

Browse files
committed
Enhance project structure with CI/CD integration, automated release workflows, and improved dependency management. Update .gitignore to include additional build artifacts and logs. Add CHANGELOG for tracking changes and implement release checklist PR template.
1 parent bfffca9 commit 0b8d510

24 files changed

+5170
-364
lines changed

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(mkdir:*)"
5+
],
6+
"deny": [],
7+
"ask": []
8+
}
9+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## Release Checklist
2+
3+
### Pre-Release Validation
4+
5+
- [ ] All tests pass locally (`yarn test`)
6+
- [ ] Linting passes (`yarn lint`)
7+
- [ ] Build completes successfully (`yarn build`)
8+
- [ ] Package builds correctly (`yarn package`)
9+
- [ ] No uncommitted changes in `dist/` folder after packaging
10+
11+
### Documentation & Versioning
12+
13+
- [ ] Version bumped in `package.json`
14+
- [ ] `CHANGELOG.md` updated with new changes
15+
- [ ] README.md updated if new features added
16+
- [ ] Action documentation updated if inputs/outputs changed
17+
18+
### Testing
19+
20+
- [ ] Integration tests pass
21+
- [ ] Action works with example workflows
22+
- [ ] No breaking changes (or documented if necessary)
23+
24+
### Release Notes
25+
26+
- [ ] Clear description of changes
27+
- [ ] Breaking changes highlighted
28+
- [ ] Migration guide provided (if needed)
29+
30+
### Post-Release
31+
32+
- [ ] Example workflows updated to use new version
33+
- [ ] Major version tag will be updated automatically
34+
- [ ] Release branch will be updated automatically
35+
36+
## Changes in this Release
37+
38+
<!-- Describe the main changes, new features, bug fixes, etc. -->
39+
40+
## Breaking Changes
41+
42+
<!-- List any breaking changes and migration instructions -->
43+
44+
## Additional Notes
45+
46+
<!-- Any additional context or notes for reviewers -->

.github/dependabot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for npm
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "09:00"
10+
open-pull-requests-limit: 10
11+
commit-message:
12+
prefix: "deps"
13+
include: "scope"
14+
reviewers:
15+
- "cyanxiao"
16+
assignees:
17+
- "cyanxiao"
18+
19+
# Enable version updates for GitHub Actions
20+
- package-ecosystem: "github-actions"
21+
directory: "/"
22+
schedule:
23+
interval: "weekly"
24+
day: "monday"
25+
time: "09:00"
26+
open-pull-requests-limit: 5
27+
commit-message:
28+
prefix: "ci"
29+
include: "scope"
30+
reviewers:
31+
- "cyanxiao"
32+
assignees:
33+
- "cyanxiao"

.github/workflows/ci.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [18, 20]
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: "yarn"
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Lint code
30+
run: yarn lint
31+
32+
- name: Build project
33+
run: yarn build
34+
35+
- name: Run tests
36+
run: yarn test
37+
38+
- name: Package action
39+
run: yarn package
40+
41+
- name: Check dist is up to date
42+
run: |
43+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
44+
echo "Detected uncommitted changes after build. See status below:"
45+
git diff --exit-code dist/
46+
echo "Run 'yarn package' and commit the changes."
47+
exit 1
48+
fi
49+
50+
integration-test:
51+
runs-on: ubuntu-latest
52+
needs: test
53+
if: github.event_name == 'pull_request'
54+
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Test action
60+
uses: ./
61+
with:
62+
account-name: "Test Account"
63+
author-name: "CI Test"
64+
include-patterns: "README.md"
65+
output-file: "test-output.json"
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: github.actor == 'dependabot[bot]'
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v1
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Enable auto-merge for patch and minor updates
20+
if: |
21+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
22+
steps.metadata.outputs.update-type == 'version-update:semver-minor'
23+
run: gh pr merge --auto --squash "$PR_URL"
24+
env:
25+
PR_URL: ${{ github.event.pull_request.html_url }}
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/example.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Convert Docs to Telegraph
33
on:
44
push:
55
branches: [main]
6+
paths:
7+
- "docs/**/*.md"
8+
- "README.md"
69
workflow_dispatch:
710

811
permissions:

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version to release (e.g., v1.2.3)"
11+
required: true
12+
type: string
13+
14+
permissions:
15+
contents: write
16+
packages: write
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: "20"
32+
cache: "yarn"
33+
34+
- name: Install dependencies
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Run tests
38+
run: yarn test
39+
40+
- name: Build and package
41+
run: |
42+
yarn build
43+
yarn package
44+
45+
- name: Get version from tag
46+
id: get_version
47+
run: |
48+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
49+
VERSION="${{ github.event.inputs.version }}"
50+
else
51+
VERSION=${GITHUB_REF#refs/tags/}
52+
fi
53+
echo "version=$VERSION" >> $GITHUB_OUTPUT
54+
echo "major_version=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_OUTPUT
55+
56+
- name: Update major version tag
57+
run: |
58+
MAJOR_VERSION=${{ steps.get_version.outputs.major_version }}
59+
git config --local user.email "[email protected]"
60+
git config --local user.name "GitHub Action"
61+
git tag -fa $MAJOR_VERSION -m "Update $MAJOR_VERSION tag"
62+
git push origin $MAJOR_VERSION --force
63+
64+
- name: Update release branch
65+
run: |
66+
git config --local user.email "[email protected]"
67+
git config --local user.name "GitHub Action"
68+
git checkout -B release
69+
git push origin release --force
70+
71+
- name: Create GitHub Release
72+
uses: softprops/action-gh-release@v1
73+
with:
74+
tag_name: ${{ steps.get_version.outputs.version }}
75+
name: Release ${{ steps.get_version.outputs.version }}
76+
draft: false
77+
prerelease: false
78+
generate_release_notes: true
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)