@@ -13,36 +13,36 @@ jobs:
1313 github.event.pull_request.merged == true &&
1414 (startsWith(github.event.pull_request.head.ref, 'release/') ||
1515 startsWith(github.event.pull_request.head.ref, 'hotfix/'))
16-
16+
1717 runs-on : ubuntu-latest
18-
18+
1919 permissions :
2020 contents : write
2121 pull-requests : read
22-
22+
2323 steps :
2424 - name : Checkout repository
2525 uses : actions/checkout@v4
2626 with :
27- fetch-depth : 0 # Need full history for changelog generation
27+ fetch-depth : 0 # Need full history for changelog generation
2828 token : ${{ secrets.GITHUB_TOKEN }}
29-
29+
3030 - name : Setup Ruby
3131 uses : ruby/setup-ruby@v1
3232 with :
33- ruby-version : ' 3.2'
34-
33+ ruby-version : " 3.2"
34+
3535 - name : Configure Git
3636 run : |
3737 git config user.name "github-actions[bot]"
3838 git config user.email "github-actions[bot]@users.noreply.github.com"
39-
39+
4040 - name : Extract version from branch name
4141 id : version
4242 run : |
4343 BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
4444 echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
45-
45+
4646 if [[ $BRANCH_NAME == release/v* ]]; then
4747 VERSION=$(echo $BRANCH_NAME | sed 's/release\/v//')
4848 TYPE="release"
@@ -52,46 +52,46 @@ jobs:
5252 TYPE="hotfix"
5353 IS_PRERELEASE="false"
5454 fi
55-
55+
5656 # Validate version format
5757 if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
5858 echo "❌ Invalid version format: $VERSION"
5959 echo "Version must be in format x.y.z"
6060 exit 1
6161 fi
62-
62+
6363 echo "version=$VERSION" >> $GITHUB_OUTPUT
6464 echo "type=$TYPE" >> $GITHUB_OUTPUT
6565 echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
6666 echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
67-
67+
6868 echo "✅ Extracted version: $VERSION ($TYPE)"
69-
69+
7070 - name : Check if tag already exists
7171 id : check_tag
7272 run : |
7373 TAG_NAME="v${{ steps.version.outputs.version }}"
74-
74+
7575 if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
7676 echo "exists=true" >> $GITHUB_OUTPUT
7777 echo "⚠️ Tag $TAG_NAME already exists"
7878 else
7979 echo "exists=false" >> $GITHUB_OUTPUT
8080 echo "✅ Tag $TAG_NAME does not exist, ready to create"
8181 fi
82-
82+
8383 - name : Generate changelog for release
8484 id : changelog
8585 run : |
8686 VERSION="${{ steps.version.outputs.version }}"
87-
87+
8888 echo "Generating changelog for version $VERSION..."
89-
89+
9090 # Generate changelog using the Ruby script
9191 ruby scripts/generate_changelog.rb \
9292 --version "$VERSION" \
9393 --output "RELEASE_CHANGELOG.md"
94-
94+
9595 if [ -f "RELEASE_CHANGELOG.md" ]; then
9696 echo "✅ Changelog generated successfully"
9797
@@ -103,26 +103,26 @@ jobs:
103103 echo "❌ Failed to generate changelog"
104104 exit 1
105105 fi
106-
106+
107107 - name : Create Git tag
108108 if : steps.check_tag.outputs.exists == 'false'
109109 run : |
110110 TAG_NAME="${{ steps.version.outputs.tag_name }}"
111111 VERSION="${{ steps.version.outputs.version }}"
112112 TYPE="${{ steps.version.outputs.type }}"
113-
113+
114114 # Create annotated tag
115115 if [ "$TYPE" = "release" ]; then
116116 TAG_MESSAGE="Release v$VERSION"
117117 else
118118 TAG_MESSAGE="Hotfix v$VERSION"
119119 fi
120-
120+
121121 git tag -a "$TAG_NAME" -m "$TAG_MESSAGE"
122122 git push origin "$TAG_NAME"
123-
123+
124124 echo "✅ Created and pushed tag: $TAG_NAME"
125-
125+
126126 - name : Create GitHub Release
127127 if : steps.check_tag.outputs.exists == 'false'
128128 env :
@@ -132,7 +132,7 @@ jobs:
132132 VERSION="${{ steps.version.outputs.version }}"
133133 TYPE="${{ steps.version.outputs.type }}"
134134 IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}"
135-
135+
136136 # Set release title and flags
137137 if [ "$TYPE" = "release" ]; then
138138 RELEASE_TITLE="🚀 Release v$VERSION"
@@ -141,52 +141,52 @@ jobs:
141141 RELEASE_TITLE="🔥 Hotfix v$VERSION"
142142 RELEASE_FLAGS=""
143143 fi
144-
144+
145145 # Add prerelease flag if needed
146146 if [ "$IS_PRERELEASE" = "true" ]; then
147147 RELEASE_FLAGS="$RELEASE_FLAGS --prerelease"
148148 fi
149-
149+
150150 # Create the GitHub release
151151 cat > release_body.md << 'RELEASE_EOF'
152152 ${{ steps.changelog.outputs.changelog }}
153-
153+
154154 ---
155-
155+
156156 ## 📦 Installation
157-
157+
158158 ### Docker
159159 ```bash
160160 docker pull ghcr.io/banua-coder/pico-api-docs:v${{ steps.version.outputs.version }}
161161 ```
162-
162+
163163 ### Manual Download
164164 Download the latest build artifacts from this release.
165-
165+
166166 ## 🔗 Related Links
167-
167+
168168 - **API Documentation**: https://pico-api-docs.banuacoder.com
169169 - **Source Code**: https://github.com/banua-coder/pico-api-docs
170170 - **Issues**: https://github.com/banua-coder/pico-api-docs/issues
171-
171+
172172 ## 📋 Changelog
173-
173+
174174 For detailed changes, see [CHANGELOG.md](https://github.com/banua-coder/pico-api-docs/blob/main/CHANGELOG.md)
175175 RELEASE_EOF
176-
176+
177177 # Create the release
178178 gh release create "$TAG_NAME" \
179179 --title "$RELEASE_TITLE" \
180180 --notes-file release_body.md \
181181 --target main \
182182 $RELEASE_FLAGS
183-
183+
184184 echo "✅ GitHub release created: $TAG_NAME"
185-
185+
186186 # Get release URL for summary
187187 RELEASE_URL=$(gh release view "$TAG_NAME" --json url -q '.url')
188188 echo "release_url=$RELEASE_URL" >> $GITHUB_OUTPUT
189-
189+
190190 - name : Summary
191191 if : always()
192192 run : |
@@ -198,7 +198,7 @@ jobs:
198198 echo "- **Type:** ${{ steps.version.outputs.type }}" >> $GITHUB_STEP_SUMMARY
199199 echo "- **Tag:** \`${{ steps.version.outputs.tag_name }}\`" >> $GITHUB_STEP_SUMMARY
200200 echo "" >> $GITHUB_STEP_SUMMARY
201-
201+
202202 if [ "${{ steps.check_tag.outputs.exists }}" == "true" ]; then
203203 echo "⚠️ **Status:** Skipped - tag already exists" >> $GITHUB_STEP_SUMMARY
204204 else
@@ -207,9 +207,9 @@ jobs:
207207 echo "🔗 **Release URL:** ${{ steps.create-release.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
208208 fi
209209 fi
210-
210+
211211 echo "" >> $GITHUB_STEP_SUMMARY
212212 echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
213213 echo "1. ✅ Tag and release created" >> $GITHUB_STEP_SUMMARY
214214 echo "2. 🔄 Backmerge to develop will run automatically" >> $GITHUB_STEP_SUMMARY
215- echo "3. 🚀 Deployment pipeline will trigger automatically" >> $GITHUB_STEP_SUMMARY
215+ echo "3. 🚀 Deployment pipeline will trigger automatically" >> $GITHUB_STEP_SUMMARY
0 commit comments