npm package: @neorayden/opengov
Description: OpenGov project - Open government data and transparency platform
Author: neorayden
Latest version: 1.3.0

# OpenGov

Open government data and transparency platform.

## GitHub Actions - Automatic Versioning & Deployment

This project is set up with automatic versioning and deployment using GitHub Actions.

### How It Works

1. **CI Workflow** (`.github/workflows/ci.yml`)
   - Runs on every push to main/master/develop branches
   - Runs on pull requests
   - Tests your code across multiple Node.js versions
   - Runs linter and build scripts

2. **Version Bump Workflow** (`.github/workflows/version-bump.yml`)
   - Automatically creates a Git tag when `package.json` version changes
   - Triggers when you push changes to `package.json` on main/master branch

3. **Release Workflow** (`.github/workflows/release.yml`)
   - Triggers when a version tag is created (e.g., `v1.0.0`)
   - Automatically:
     - Updates `package.json` version
     - Runs tests
     - Builds the project
     - Publishes to npm (if `NPM_TOKEN` secret is configured)
     - **Deploys to Vercel** (if `VERCEL_TOKEN` secret is configured)
     - Creates a GitHub Release with deployment URL

### Usage

#### Option 1: Manual Version Bump (Recommended)

1. Update the version in `package.json`:
   ```json
   {
     "version": "1.0.0"
   }
   ```

2. Commit and push:
   ```bash
   git add package.json
   git commit -m "chore: bump version to 1.0.0"
   git push
   ```

3. The workflow will automatically create a tag and trigger the release.

#### Option 2: Create Tag Manually

1. Create and push a tag:
   ```bash
   git tag -a v1.0.0 -m "Release version 1.0.0"
   git push origin v1.0.0
   ```

2. The release workflow will automatically:
   - Extract the version from the tag
   - Update `package.json`
   - Build, test, and publish

#### Option 3: Use GitHub Actions UI

1. Go to Actions → Release workflow
2. Click "Run workflow"
3. Enter the version number (e.g., `1.0.0`)
4. Click "Run workflow"

### Setup Requirements

#### For npm Publishing (Optional)

If you want to publish to npm:

1. **Create an npm account** (if you don't have one): https://www.npmjs.com/signup

2. **Create an npm access token**:
   - Go to: https://www.npmjs.com/settings/[your-username]/tokens
   - Click "Generate New Token"
   - Select "Automation" type
   - Copy the token

3. **Add it as a GitHub secret**:
   - Go to: https://github.com/neorayden/OpenGov/settings/secrets/actions
   - Click "New repository secret"
   - Name: `NPM_TOKEN` (exact name, case-sensitive)
   - Value: Your npm token
   - Click "Add secret"

**Note**: Your package name is `@neorayden/opengov`. Make sure your npm username matches `neorayden`, or update the package name in `package.json` to match your username.

See `SETUP_NPM.md` for detailed instructions.

#### For Vercel Deployment (Required for automatic deployments)

**IMPORTANT:** Add your Vercel token as a GitHub secret:

1. Go to: https://github.com/neorayden/OpenGov/settings/secrets/actions
2. Click "New repository secret"
3. Name: `VERCEL_TOKEN`
4. Value: `94CfYX9PlkfjCnYNwcOW9iCS`
5. Click "Add secret"

The workflow will automatically:
- Create/link the Vercel project on first deployment
- Deploy to Vercel production on each release
- Include the deployment URL in the GitHub Release notes

#### Version Format

Use [Semantic Versioning](https://semver.org/):
- `MAJOR.MINOR.PATCH` (e.g., `1.0.0`)
- Tags should be prefixed with `v` (e.g., `v1.0.0`)

### Customization

Edit the workflow files in `.github/workflows/` to:
- Change Node.js versions
- Add/remove build steps
- Modify deployment targets
- Adjust test commands

### Scripts

Update the scripts in `package.json`:
- `test`: Your test command
- `lint`: Your linter command
- `build`: Your build command