@gv-sh/specgen-app 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,91 @@
1
+ name: Publish to NPM
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Triggers on version tags like v0.1.0, v0.1.1, etc.
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0 # Fetch all history for tags and branches
19
+ ref: ${{ github.ref }}
20
+
21
+ - name: Setup Node.js
22
+ uses: actions/setup-node@v4
23
+ with:
24
+ node-version: '18'
25
+ registry-url: 'https://registry.npmjs.org'
26
+
27
+ - name: Get version from package.json
28
+ id: package-version
29
+ uses: martinbeentjes/npm-get-version-action@v1.3.1
30
+
31
+ - name: Commit and push if changed
32
+ run: |
33
+ git config --local user.email "action@github.com"
34
+ git config --local user.name "GitHub Action"
35
+
36
+ # Extract the main branch name
37
+ MAIN_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
38
+
39
+ # Create a new branch from main for the badge update
40
+ git fetch origin $MAIN_BRANCH:$MAIN_BRANCH
41
+ git checkout $MAIN_BRANCH
42
+
43
+ # Pull latest changes to avoid conflicts
44
+ git pull --rebase origin $MAIN_BRANCH
45
+
46
+ # Update the README badge
47
+ VERSION="${{ steps.package-version.outputs.current-version }}"
48
+ sed -i "s/version-[0-9]\+\.[0-9]\+\.[0-9]\+/version-${VERSION}/g" README.md
49
+
50
+ # Verify the change was made
51
+ grep "version-" README.md
52
+
53
+ git add README.md
54
+
55
+ # Check if there are changes to commit
56
+ if git diff --staged --quiet; then
57
+ echo "No changes to commit"
58
+ else
59
+ git commit -m "Update version badge to v${{ steps.package-version.outputs.current-version }}"
60
+ # Use --force-with-lease for safer force pushing that checks remote changes
61
+ git push --force-with-lease origin $MAIN_BRANCH
62
+ fi
63
+
64
+ - name: Install dependencies
65
+ run: npm install
66
+
67
+ - name: Test setup process
68
+ run: |
69
+ # Run setup to verify everything works
70
+ npm run setup
71
+
72
+ # Verify all components are extracted
73
+ if [ ! -d "server" ]; then
74
+ echo "Error: server directory not found"
75
+ exit 1
76
+ fi
77
+ if [ ! -d "admin" ]; then
78
+ echo "Error: admin directory not found"
79
+ exit 1
80
+ fi
81
+ if [ ! -d "user" ]; then
82
+ echo "Error: user directory not found"
83
+ exit 1
84
+ fi
85
+
86
+ echo "Setup verification completed successfully"
87
+
88
+ - name: Publish to NPM
89
+ run: npm publish
90
+ env:
91
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,94 @@
1
+ name: Release Process
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Triggers on version tags like v0.1.3, v0.1.4, etc.
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: '18'
24
+ registry-url: 'https://registry.npmjs.org'
25
+
26
+ - name: Extract version from tag
27
+ id: extract-version
28
+ run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
29
+
30
+ - name: Update README badge
31
+ run: |
32
+ # Update the version badge in README.md
33
+ VERSION="${{ steps.extract-version.outputs.VERSION }}"
34
+ sed -i "s/version-[0-9]\+\.[0-9]\+\.[0-9]\+/version-${VERSION}/g" README.md
35
+
36
+ # Verify the change was made
37
+ grep "version-" README.md
38
+
39
+ - name: Install dependencies
40
+ run: npm install
41
+
42
+ - name: Test setup process
43
+ run: |
44
+ # Run setup to verify everything works
45
+ npm run setup
46
+
47
+ # Verify all components are extracted
48
+ if [ ! -d "server" ]; then
49
+ echo "Error: server directory not found"
50
+ exit 1
51
+ fi
52
+ if [ ! -d "admin" ]; then
53
+ echo "Error: admin directory not found"
54
+ exit 1
55
+ fi
56
+ if [ ! -d "user" ]; then
57
+ echo "Error: user directory not found"
58
+ exit 1
59
+ fi
60
+
61
+ echo "Setup verification completed successfully"
62
+
63
+ - name: Publish to NPM
64
+ run: npm publish
65
+ env:
66
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
67
+
68
+ - name: Commit README changes to main branch
69
+ run: |
70
+ # Save current commit information
71
+ CURRENT_COMMIT=$(git rev-parse HEAD)
72
+
73
+ # Configure git
74
+ git config --local user.email "action@github.com"
75
+ git config --local user.name "GitHub Action"
76
+
77
+ # Checkout main branch
78
+ git fetch origin main:main
79
+ git checkout main
80
+
81
+ # Update the version badge in README.md on main branch
82
+ VERSION="${{ steps.extract-version.outputs.VERSION }}"
83
+ sed -i "s/version-[0-9]\+\.[0-9]\+\.[0-9]\+/version-${VERSION}/g" README.md
84
+
85
+ git add README.md
86
+
87
+ # Only commit if there are changes
88
+ if ! git diff --staged --quiet; then
89
+ git commit -m "Update version badge to v${VERSION} [skip ci]"
90
+ git push origin main
91
+ fi
92
+
93
+ # Return to the original commit
94
+ git checkout ${CURRENT_COMMIT}
@@ -0,0 +1,61 @@
1
+ name: Update Version Badge
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main # or your default branch
7
+ paths:
8
+ - 'package.json' # Only run when package.json changes
9
+
10
+ jobs:
11
+ update-badge:
12
+ runs-on: ubuntu-latest
13
+ permissions:
14
+ contents: write
15
+
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+ with:
20
+ fetch-depth: 0
21
+
22
+ - name: Setup Node.js
23
+ uses: actions/setup-node@v4
24
+ with:
25
+ node-version: '18'
26
+
27
+ - name: Get version from package.json
28
+ id: package-version
29
+ uses: martinbeentjes/npm-get-version-action@v1.3.1
30
+
31
+ - name: Update README badge
32
+ run: |
33
+ # Replace the version badge in README.md
34
+ VERSION="${{ steps.package-version.outputs.current-version }}"
35
+
36
+ # Use sed to replace the version in the badge URL
37
+ sed -i "s/version-[0-9]\+\.[0-9]\+\.[0-9]\+/version-${VERSION}/g" README.md
38
+
39
+ # Verify the change was made
40
+ grep "version-" README.md
41
+
42
+ - name: Commit and push if changed
43
+ run: |
44
+ git config --local user.email "action@github.com"
45
+ git config --local user.name "GitHub Action"
46
+
47
+ BRANCH_NAME=$(git symbolic-ref --short HEAD)
48
+
49
+ # Pull latest changes to avoid conflicts
50
+ git pull --rebase origin $BRANCH_NAME
51
+
52
+ git add README.md
53
+
54
+ # Check if there are changes to commit
55
+ if git diff --staged --quiet; then
56
+ echo "No changes to commit"
57
+ exit 0
58
+ fi
59
+
60
+ git commit -m "Update version badge to v${{ steps.package-version.outputs.current-version }}"
61
+ git push --force-with-lease origin $BRANCH_NAME
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # SpecGen App - Complete Platform
2
2
 
3
+ [![Version](https://img.shields.io/badge/version-0.1.5-blue.svg)](https://github.com/gv-sh/specgen-app)
4
+
3
5
  A unified deployment package for the SpecGen speculative fiction generator platform.
4
6
 
5
7
  ## Components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gv-sh/specgen-app",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Complete SpecGen application with server, admin, and user interfaces",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,49 +0,0 @@
1
- name: Publish to NPM
2
-
3
- on:
4
- push:
5
- tags:
6
- - 'v*' # Triggers on version tags like v0.1.0, v0.1.1, etc.
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v4
15
-
16
- - name: Setup Node.js
17
- uses: actions/setup-node@v4
18
- with:
19
- node-version: '18'
20
- registry-url: 'https://registry.npmjs.org'
21
-
22
- - name: Install dependencies
23
- run: npm install
24
-
25
- - name: Test setup process
26
- run: |
27
- # Run setup to verify everything works
28
- npm run setup
29
-
30
- # Verify all components are extracted
31
- if [ ! -d "server" ]; then
32
- echo "Error: server directory not found"
33
- exit 1
34
- fi
35
- if [ ! -d "admin" ]; then
36
- echo "Error: admin directory not found"
37
- exit 1
38
- fi
39
- if [ ! -d "user" ]; then
40
- echo "Error: user directory not found"
41
- exit 1
42
- fi
43
-
44
- echo "Setup verification completed successfully"
45
-
46
- - name: Publish to NPM
47
- run: npm publish
48
- env:
49
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}