Skip to content

Commit a0c8143

Browse files
committed
update workflow
1 parent 36192f4 commit a0c8143

File tree

3 files changed

+3
-252
lines changed

3 files changed

+3
-252
lines changed

.github/workflows/WORKFLOW-README.md

Lines changed: 0 additions & 173 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Release
1+
name: CI
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
jobs:
10-
build:
10+
test-and-build:
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -23,81 +23,5 @@ jobs:
2323
- name: Install dependencies
2424
run: npm ci
2525

26-
- name: Run linting
27-
run: npm run lint
28-
2926
- name: Build application
3027
run: npm run build
31-
32-
release:
33-
needs: build
34-
runs-on: ubuntu-latest
35-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
36-
37-
permissions:
38-
contents: write
39-
40-
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v4
43-
with:
44-
fetch-depth: 0
45-
token: ${{ secrets.GITHUB_TOKEN }}
46-
47-
- name: Setup Node.js
48-
uses: actions/setup-node@v4
49-
with:
50-
node-version: "20.x"
51-
cache: "npm"
52-
53-
- name: Configure Git
54-
run: |
55-
git config user.name "github-actions[bot]"
56-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57-
58-
- name: Bump version and update changelog
59-
run: |
60-
# Get commit messages since last tag
61-
COMMIT_MESSAGES=$(git log --pretty=format:"%s" $(git describe --tags --abbrev=0 2>/dev/null || echo "HEAD~10")..HEAD)
62-
63-
# Determine version bump type based on commit messages
64-
if echo "$COMMIT_MESSAGES" | grep -qE "^major(\(.+\))?:"; then
65-
BUMP_TYPE="major"
66-
elif echo "$COMMIT_MESSAGES" | grep -qE "^feat(\(.+\))?:"; then
67-
BUMP_TYPE="minor"
68-
else
69-
BUMP_TYPE="patch"
70-
fi
71-
72-
echo "Detected bump type: $BUMP_TYPE"
73-
74-
# Bump version
75-
npm version $BUMP_TYPE --no-git-tag-version
76-
NEW_VERSION=$(node -p "require('./package.json').version")
77-
78-
# Generate changelog entry with commit details
79-
DATE=$(date +"%Y-%m-%d")
80-
CHANGELOG_ENTRY="## [$NEW_VERSION] - $DATE\n\n"
81-
82-
# Add commits to changelog
83-
while IFS= read -r commit; do
84-
if [ ! -z "$commit" ]; then
85-
CHANGELOG_ENTRY="${CHANGELOG_ENTRY}- $commit\n"
86-
fi
87-
done <<< "$COMMIT_MESSAGES"
88-
89-
CHANGELOG_ENTRY="${CHANGELOG_ENTRY}\n"
90-
91-
# Update CHANGELOG.md
92-
if [ -f "CHANGELOG.md" ]; then
93-
sed -i "3i\\$CHANGELOG_ENTRY" CHANGELOG.md
94-
else
95-
echo -e "# Changelog\n\n$CHANGELOG_ENTRY" > CHANGELOG.md
96-
fi
97-
98-
# Commit and push
99-
git add package.json CHANGELOG.md
100-
git commit -m "chore: bump version to v$NEW_VERSION [skip ci]"
101-
git tag "v$NEW_VERSION"
102-
git push origin main
103-
git push origin "v$NEW_VERSION"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "elysia",
3-
"version": "1.0.0",
3+
"version": "0.2.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

0 commit comments

Comments
 (0)