Skip to content

Commit 0bf8bce

Browse files
~0.1.7: added 2 new workflows #47 and #48 (#49)
1 parent 716c322 commit 0bf8bce

File tree

5 files changed

+171
-3
lines changed

5 files changed

+171
-3
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: "Release Branch Check"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- prod
7+
8+
jobs:
9+
check_branch:
10+
name: Verify Branch Source
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check Source Branch
14+
env:
15+
SOURCE_BRANCH: ${{ github.head_ref }}
16+
run: |
17+
ALLOWED_BRANCH="main"
18+
19+
echo "Pull Request from branch $SOURCE_BRANCH"
20+
21+
if [ "$SOURCE_BRANCH" != "$ALLOWED_BRANCH" ]; then
22+
echo "ERROR: Merges to the 'prod' are only allowed from the $ALLOWED_BRANCH branch."
23+
exit 1
24+
fi
25+
26+
check_sync:
27+
name: Verify Branch Sync
28+
runs-on: ubuntu-latest
29+
needs: check_branch
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Fetch both branches
37+
run: |
38+
git fetch origin main prod
39+
40+
- name: Check if prod is ancestor of main
41+
id: check_ancestor
42+
run: |
43+
COMMAND="git merge-base --is-ancestor origin/prod origin/main"
44+
if $COMMAND; then
45+
echo "✅ main is in sync with prod"
46+
echo "sync_status=ok" >> $GITHUB_OUTPUT
47+
else
48+
echo "❌ main is NOT in sync with prod"
49+
echo "sync_status=out_of_sync" >> $GITHUB_OUTPUT
50+
fi
51+
52+
- name: Comment on PR if out of sync
53+
if: ${{ steps.check_ancestor.outputs.sync_status == 'out_of_sync' }}
54+
uses: actions/github-script@v7
55+
with:
56+
script: |
57+
const body = `
58+
⚠️ **Sync Check Failed**
59+
60+
The \`main\` branch is **not in sync** with \`prod\`.
61+
62+
Please run the following locally to fix it:
63+
\`\`\`bash
64+
git fetch origin main prod
65+
git checkout main
66+
git merge --ff-only origin/prod || git merge origin/prod --strategy=ours -m "Sync main with prod"
67+
git push origin main
68+
\`\`\`
69+
70+
After syncing, re-run this workflow or update the PR.
71+
`;
72+
github.rest.issues.createComment({
73+
issue_number: context.issue.number,
74+
owner: context.repo.owner,
75+
repo: context.repo.repo,
76+
body
77+
});
78+
core.setFailed("main is out of sync with prod");

.github/workflows/release-tag.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Auto Tagging"
2+
3+
on:
4+
push:
5+
branches:
6+
- prod
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
tag_release:
13+
name: Create Tag - vX.X.X
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Read version from package.json
23+
id: pkg
24+
run: |
25+
VERSION=$(node -p "require('./package.json').version")
26+
echo "Version from package.json: $VERSION"
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
29+
- name: Fetch tags from origin
30+
run: |
31+
git fetch --tags --prune
32+
33+
- name: Check if tag already exists (remote)
34+
id: check
35+
run: |
36+
TAG="v${{ steps.pkg.outputs.version }}"
37+
echo "Checking for tag $TAG on remote..."
38+
if git ls-remote --tags origin "$TAG" | grep -q "$TAG"; then
39+
echo "Tag $TAG already exists on remote. Skipping."
40+
echo "exists=true" >> $GITHUB_OUTPUT
41+
else
42+
# also check locally as a fallback
43+
if git rev-parse "$TAG" >/dev/null 2>&1; then
44+
echo "Tag $TAG already exists locally. Skipping."
45+
echo "exists=true" >> $GITHUB_OUTPUT
46+
else
47+
echo "exists=false" >> $GITHUB_OUTPUT
48+
fi
49+
fi
50+
51+
- name: Create and push annotated tag
52+
if: steps.check.outputs.exists == 'false'
53+
run: |
54+
git config user.name "github-actions"
55+
git config user.email "github-actions@github.com"
56+
57+
TAG="v${{ steps.pkg.outputs.version }}"
58+
git tag -a "$TAG" -m "Release $TAG"
59+
git push origin "$TAG"
60+
61+
- name: Create GitHub release
62+
if: steps.check.outputs.exists == 'false'
63+
uses: softprops/action-gh-release@v2
64+
with:
65+
tag_name: "v${{ steps.pkg.outputs.version }}"
66+
name: "Release v${{ steps.pkg.outputs.version }}"
67+
body: |
68+
🚀 **Automatic Release**
69+
70+
Version: v${{ steps.pkg.outputs.version }}
71+
Triggered by merge into `prod`.
72+
73+
Commit: ${{ github.sha }}

Todo.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@
33
- [ ] check mobile responsiveness of the components previous to feedback modal.
44
- [ ] [IMP] update the manual hook installation for respective comp. (steps)
55
- [ ] fix scroll bar in manual boxes and code boxes (either make them small or remove them).
6-
- [ ] do we need bread crumbs for sub headings?
76
- [ ] update docs to `Fuma docs`
87
- [ ] thinking of sepearating landing:`aetherui.in` and docs:`ui.aetherui.in` by upgrading from nextjs to monorepo setup. This will allow us to divide the load.
98
- [ ] create sitemap and robots.txt.
109
- [ ] there is a stupid bug in `page.mdx` file, where inside tabs "manual" the step 2's margin up is not working.(fix for now custom css)
1110
- [ ] update loading animation.
1211
- [ ] right now the `SmoothSlider` doesnt shift content to right in extreme left and vice versa. Its a bug.
1312
- [ ] wrap the text in `code-preview`/`code-renderer` in the `pre` tag.
14-
- [x] fix the add to v0 issue
1513
- [ ] the side bar in the doc which show the break point for the headings should slice the text and show the first line of the heading.
1614
- [ ] update the eslint rule for `unused-vars` to `error` and fix all the issues.
15+
16+
---
17+
18+
### SEO
19+
20+
- [ ] create `sitemap.xml` and `robots.txt`.
21+
- [ ] Add specific metadata to the landing page.
22+
- [ ] Add specific metadata to MDX pages.
23+
- [ ] Review and update `site.ts` and ensure all the information is accurate and complete. The `fallbackURL` should be updated to the production URL.

event.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"pull_request": {
3+
"head": {
4+
"ref": "main"
5+
},
6+
"base": {
7+
"ref": "prod"
8+
}
9+
}
10+
}

package.json

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

0 commit comments

Comments
 (0)