Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5fe2cbd
Merge pull request #7 from banua-coder/main
ryanaidilp Sep 8, 2025
2fb5dad
Merge branch 'main' into develop
ryanaidilp Sep 8, 2025
03eba28
feat: update API documentation with correct parameters and new endpoints
ryanaidilp Sep 8, 2025
04a2e51
feat: complete API documentation overhaul with logo-matching design
ryanaidilp Sep 8, 2025
3b9de06
refactor: redesign documentation sections with clean table-based layout
ryanaidilp Sep 8, 2025
f1828d5
fix: remove outdated exclude_latest_case parameter from provinces end…
ryanaidilp Sep 8, 2025
be049e6
Merge pull request #8 from banua-coder/feature/update-api-documentati…
ryanaidilp Sep 8, 2025
1178589
feat: implement GitFlow workflow automation following pico-api-go pat…
ryanaidilp Sep 8, 2025
ae9edbb
feat: enhance national historical data documentation
ryanaidilp Sep 8, 2025
5a0dca6
fix: workflow syntax and formatting improvements
ryanaidilp Sep 8, 2025
a970f94
style: add trailing newlines to all source files
ryanaidilp Sep 8, 2025
e7807a8
chore: remove unnecessary image.png file
ryanaidilp Sep 8, 2025
6a1df96
Merge pull request #9 from banua-coder/feature/enhance-national-histo…
ryanaidilp Sep 8, 2025
79c1094
feat: update API documentation to match latest backend implementation
ryanaidilp Sep 8, 2025
d35f65a
Merge pull request #10 from banua-coder/feature/update-api-docs-with-…
ryanaidilp Sep 8, 2025
c269896
chore: prepare v1.1.0 release
github-actions[bot] Sep 8, 2025
395a9ea
fix(script): fix changelog generator script
ryanaidilp Sep 8, 2025
bcaf59f
docs(CHANGELOG): re-generate changelog
ryanaidilp Sep 8, 2025
714d4aa
Merge pull request #11 from banua-coder/chore/prepare-release-v1.1.0
ryanaidilp Sep 8, 2025
cac86e4
style: add trailing newline to changelog script
ryanaidilp Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/backmerge-to-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,42 @@ jobs:
github.event.pull_request.merged == true &&
(startsWith(github.event.pull_request.head.ref, 'release/') ||
startsWith(github.event.pull_request.head.ref, 'hotfix/'))

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches
fetch-depth: 0 # Fetch all history for all branches
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Extract version from branch name
id: version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

if [[ $BRANCH_NAME == release/v* ]]; then
VERSION=$(echo $BRANCH_NAME | sed 's/release\/v//')
TYPE="release"
elif [[ $BRANCH_NAME == hotfix/v* ]]; then
VERSION=$(echo $BRANCH_NAME | sed 's/hotfix\/v//')
TYPE="hotfix"
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "type=$TYPE" >> $GITHUB_OUTPUT

- name: Check if develop branch exists
id: check_develop
run: |
Expand All @@ -58,24 +58,24 @@ jobs:
echo "exists=false" >> $GITHUB_OUTPUT
echo "⚠️ Develop branch does not exist. Skipping backmerge."
fi

- name: Create backmerge pull request
if: steps.check_develop.outputs.exists == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Create a unique branch name for the backmerge
BACKMERGE_BRANCH="backmerge/main-to-develop-$(date +%Y%m%d-%H%M%S)"

# Fetch and checkout develop
git fetch origin develop:develop

# Create new branch from develop
git checkout -b $BACKMERGE_BRANCH develop

# Merge main into the backmerge branch
echo "Attempting to merge main into $BACKMERGE_BRANCH..."

# Try to merge main
if git merge origin/main --no-edit; then
echo "βœ… Merge successful, no conflicts"
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
# Exit with error to mark the job as failed
exit 1
fi

- name: Summary
if: always()
run: |
Expand All @@ -195,9 +195,9 @@ jobs:
echo "- **Target Branch:** \`develop\`" >> $GITHUB_STEP_SUMMARY
echo "- **Triggered by:** @${{ github.event.pull_request.merged_by.login }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ steps.check_develop.outputs.exists }}" == "false" ]; then
echo "⚠️ **Status:** Skipped - develop branch does not exist" >> $GITHUB_STEP_SUMMARY
else
echo "βœ… **Status:** Backmerge PR created" >> $GITHUB_STEP_SUMMARY
fi
fi
82 changes: 41 additions & 41 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ jobs:
github.event.pull_request.merged == true &&
(startsWith(github.event.pull_request.head.ref, 'release/') ||
startsWith(github.event.pull_request.head.ref, 'hotfix/'))

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: read

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Need full history for changelog generation
fetch-depth: 0 # Need full history for changelog generation
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
ruby-version: "3.2"

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Extract version from branch name
id: version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

if [[ $BRANCH_NAME == release/v* ]]; then
VERSION=$(echo $BRANCH_NAME | sed 's/release\/v//')
TYPE="release"
Expand All @@ -52,46 +52,46 @@ jobs:
TYPE="hotfix"
IS_PRERELEASE="false"
fi

# Validate version format
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "❌ Invalid version format: $VERSION"
echo "Version must be in format x.y.z"
exit 1
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "type=$TYPE" >> $GITHUB_OUTPUT
echo "tag_name=v$VERSION" >> $GITHUB_OUTPUT
echo "is_prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT

echo "βœ… Extracted version: $VERSION ($TYPE)"

- name: Check if tag already exists
id: check_tag
run: |
TAG_NAME="v${{ steps.version.outputs.version }}"

if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "⚠️ Tag $TAG_NAME already exists"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "βœ… Tag $TAG_NAME does not exist, ready to create"
fi

- name: Generate changelog for release
id: changelog
run: |
VERSION="${{ steps.version.outputs.version }}"

echo "Generating changelog for version $VERSION..."

# Generate changelog using the Ruby script
ruby scripts/generate_changelog.rb \
--version "$VERSION" \
--output "RELEASE_CHANGELOG.md"

if [ -f "RELEASE_CHANGELOG.md" ]; then
echo "βœ… Changelog generated successfully"

Expand All @@ -103,26 +103,26 @@ jobs:
echo "❌ Failed to generate changelog"
exit 1
fi

- name: Create Git tag
if: steps.check_tag.outputs.exists == 'false'
run: |
TAG_NAME="${{ steps.version.outputs.tag_name }}"
VERSION="${{ steps.version.outputs.version }}"
TYPE="${{ steps.version.outputs.type }}"

# Create annotated tag
if [ "$TYPE" = "release" ]; then
TAG_MESSAGE="Release v$VERSION"
else
TAG_MESSAGE="Hotfix v$VERSION"
fi

git tag -a "$TAG_NAME" -m "$TAG_MESSAGE"
git push origin "$TAG_NAME"

echo "βœ… Created and pushed tag: $TAG_NAME"

- name: Create GitHub Release
if: steps.check_tag.outputs.exists == 'false'
env:
Expand All @@ -132,7 +132,7 @@ jobs:
VERSION="${{ steps.version.outputs.version }}"
TYPE="${{ steps.version.outputs.type }}"
IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}"

# Set release title and flags
if [ "$TYPE" = "release" ]; then
RELEASE_TITLE="πŸš€ Release v$VERSION"
Expand All @@ -141,52 +141,52 @@ jobs:
RELEASE_TITLE="πŸ”₯ Hotfix v$VERSION"
RELEASE_FLAGS=""
fi

# Add prerelease flag if needed
if [ "$IS_PRERELEASE" = "true" ]; then
RELEASE_FLAGS="$RELEASE_FLAGS --prerelease"
fi

# Create the GitHub release
cat > release_body.md << 'RELEASE_EOF'
${{ steps.changelog.outputs.changelog }}

---

## πŸ“¦ Installation

### Docker
```bash
docker pull ghcr.io/banua-coder/pico-api-docs:v${{ steps.version.outputs.version }}
```

### Manual Download
Download the latest build artifacts from this release.

## πŸ”— Related Links

- **API Documentation**: https://pico-api-docs.banuacoder.com
- **Source Code**: https://github.com/banua-coder/pico-api-docs
- **Issues**: https://github.com/banua-coder/pico-api-docs/issues

## πŸ“‹ Changelog

For detailed changes, see [CHANGELOG.md](https://github.com/banua-coder/pico-api-docs/blob/main/CHANGELOG.md)
RELEASE_EOF

# Create the release
gh release create "$TAG_NAME" \
--title "$RELEASE_TITLE" \
--notes-file release_body.md \
--target main \
$RELEASE_FLAGS

echo "βœ… GitHub release created: $TAG_NAME"

# Get release URL for summary
RELEASE_URL=$(gh release view "$TAG_NAME" --json url -q '.url')
echo "release_url=$RELEASE_URL" >> $GITHUB_OUTPUT

- name: Summary
if: always()
run: |
Expand All @@ -198,7 +198,7 @@ jobs:
echo "- **Type:** ${{ steps.version.outputs.type }}" >> $GITHUB_STEP_SUMMARY
echo "- **Tag:** \`${{ steps.version.outputs.tag_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ steps.check_tag.outputs.exists }}" == "true" ]; then
echo "⚠️ **Status:** Skipped - tag already exists" >> $GITHUB_STEP_SUMMARY
else
Expand All @@ -207,9 +207,9 @@ jobs:
echo "πŸ”— **Release URL:** ${{ steps.create-release.outputs.release_url }}" >> $GITHUB_STEP_SUMMARY
fi
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Steps" >> $GITHUB_STEP_SUMMARY
echo "1. βœ… Tag and release created" >> $GITHUB_STEP_SUMMARY
echo "2. πŸ”„ Backmerge to develop will run automatically" >> $GITHUB_STEP_SUMMARY
echo "3. πŸš€ Deployment pipeline will trigger automatically" >> $GITHUB_STEP_SUMMARY
echo "3. πŸš€ Deployment pipeline will trigger automatically" >> $GITHUB_STEP_SUMMARY
Loading
Loading