|
| 1 | +# 🚀 Releasing a New Version of the Neon Schema Diff Action |
| 2 | + |
| 3 | +This document provides step-by-step instructions for maintainers to release a |
| 4 | +new version of the Neon Schema Diff Action. |
| 5 | + |
| 6 | +## Prerequisites |
| 7 | + |
| 8 | +- Write access to the repository |
| 9 | +- Git configured with appropriate credentials |
| 10 | +- Node.js 21+ installed |
| 11 | +- Bun package manager installed |
| 12 | + |
| 13 | +## Release Process |
| 14 | + |
| 15 | +### 1. Create a Release Branch |
| 16 | + |
| 17 | +Create a new branch following the naming convention `release/X.Y.Z`: |
| 18 | + |
| 19 | +```bash |
| 20 | +git checkout main |
| 21 | +git pull origin main |
| 22 | +git checkout -b release/X.Y.Z |
| 23 | +``` |
| 24 | + |
| 25 | +Replace `X.Y.Z` with the appropriate semantic version number (e.g., |
| 26 | +`release/1.2.0`). |
| 27 | + |
| 28 | +### 2. Update Version Number |
| 29 | + |
| 30 | +Update the `version` attribute in `package.json`: |
| 31 | + |
| 32 | +```json |
| 33 | +{ |
| 34 | + "version": "X.Y.Z" |
| 35 | +} |
| 36 | +``` |
| 37 | + |
| 38 | +### 3. Development Setup and Verification |
| 39 | + |
| 40 | +Follow the same steps described in the |
| 41 | +[development documentation](./development.md): |
| 42 | + |
| 43 | +#### Install Dependencies |
| 44 | + |
| 45 | +```bash |
| 46 | +bun install |
| 47 | +``` |
| 48 | + |
| 49 | +#### Run Tests |
| 50 | + |
| 51 | +```bash |
| 52 | +bun run test |
| 53 | +``` |
| 54 | + |
| 55 | +Ensure all tests pass before proceeding. |
| 56 | + |
| 57 | +#### Verify Action Locally |
| 58 | + |
| 59 | +```bash |
| 60 | +cp .env.example .env |
| 61 | +# Configure your environment variables in .env |
| 62 | +bun run local-action |
| 63 | +``` |
| 64 | + |
| 65 | +Test the action thoroughly to ensure it works as expected with the new version. |
| 66 | + |
| 67 | +#### Package TypeScript for Distribution |
| 68 | + |
| 69 | +```bash |
| 70 | +bun run bundle |
| 71 | +``` |
| 72 | + |
| 73 | +### 4. Create Pull Request |
| 74 | + |
| 75 | +1. Commit your changes: |
| 76 | + |
| 77 | + ```bash |
| 78 | + git add . |
| 79 | + git commit -m "build: bump version to X.Y.Z" |
| 80 | + git push origin release/X.Y.Z |
| 81 | + ``` |
| 82 | + |
| 83 | +2. Create a pull request from `release/X.Y.Z` to `main` branch |
| 84 | +3. Ensure all CI checks pass |
| 85 | +4. Get the pull request reviewed and approved |
| 86 | +5. Merge the pull request to `main` |
| 87 | + |
| 88 | +### 5. Create Git Tags |
| 89 | + |
| 90 | +After the PR is merged, create the necessary Git tags: |
| 91 | + |
| 92 | +```bash |
| 93 | +git checkout main |
| 94 | +git pull origin main |
| 95 | + |
| 96 | +# Create the specific version tag |
| 97 | +git tag vX.Y.Z |
| 98 | +git push origin vX.Y.Z |
| 99 | + |
| 100 | +# Update the major version tag (e.g., v1, v2, etc.) |
| 101 | +git tag -f vX |
| 102 | +git push origin vX --force |
| 103 | +``` |
| 104 | + |
| 105 | +**Note**: The major version tag (e.g., `v1`) allows users to reference the |
| 106 | +latest version within that major release automatically. |
| 107 | + |
| 108 | +### 6. Create GitHub Release |
| 109 | + |
| 110 | +Follow the |
| 111 | +[GitHub documentation for creating releases](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release): |
| 112 | + |
| 113 | +1. Navigate to the repository on GitHub |
| 114 | +2. Click **Releases** on the right side of the repository page |
| 115 | +3. Click **Draft a new release** |
| 116 | +4. Configure the release: |
| 117 | + - **Choose a tag**: Select `vX.Y.Z` (the tag you just created) |
| 118 | + - **Release title**: `vX.Y.Z` |
| 119 | + - **Description**: Generate release notes |
| 120 | +5. Click **Publish release** |
0 commit comments