@neorayden/opengov
v1.3.0
Published
OpenGov project - Open government data and transparency platform
Maintainers
Readme
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
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
Version Bump Workflow (
.github/workflows/version-bump.yml)- Automatically creates a Git tag when
package.jsonversion changes - Triggers when you push changes to
package.jsonon main/master branch
- Automatically creates a Git tag when
Release Workflow (
.github/workflows/release.yml)- Triggers when a version tag is created (e.g.,
v1.0.0) - Automatically:
- Updates
package.jsonversion - Runs tests
- Builds the project
- Publishes to npm (if
NPM_TOKENsecret is configured) - Deploys to Vercel (if
VERCEL_TOKENsecret is configured) - Creates a GitHub Release with deployment URL
- Updates
- Triggers when a version tag is created (e.g.,
Usage
Option 1: Manual Version Bump (Recommended)
Update the version in
package.json:{ "version": "1.0.0" }Commit and push:
git add package.json git commit -m "chore: bump version to 1.0.0" git pushThe workflow will automatically create a tag and trigger the release.
Option 2: Create Tag Manually
Create and push a tag:
git tag -a v1.0.0 -m "Release version 1.0.0" git push origin v1.0.0The release workflow will automatically:
- Extract the version from the tag
- Update
package.json - Build, test, and publish
Option 3: Use GitHub Actions UI
- Go to Actions → Release workflow
- Click "Run workflow"
- Enter the version number (e.g.,
1.0.0) - Click "Run workflow"
Setup Requirements
For npm Publishing (Optional)
If you want to publish to npm:
Create an npm account (if you don't have one): https://www.npmjs.com/signup
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
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:
- Go to: https://github.com/neorayden/OpenGov/settings/secrets/actions
- Click "New repository secret"
- Name:
VERCEL_TOKEN - Value:
94CfYX9PlkfjCnYNwcOW9iCS - 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:
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 commandlint: Your linter commandbuild: Your build command
