A simple yet powerful PowerShell script that automates the entire process of creating a new release on GitHub for any project.
This tool is designed for developers who want a standardized, interactive, and reliable way to publish new versions of their software without manual steps on the GitHub website.
- Stateful & Intelligent: Remembers your project's name and latest version in a local
publish.config.json
file. - Smart Versioning: Automatically suggests the next patch version number (e.g., suggests
1.0.1
if the last release was1.0.0
). - Interactive: Guides the user through the release process, asking for a version number, commit message, and release notes.
- Automatic Archiving: Creates a clean
.zip
archive of your project, automatically excluding Git files, build scripts, and other unnecessary artifacts. - Full Automation: Handles all Git commands (
add
,commit
,tag
,push
) and GitHub CLI commands (gh release create
,gh release upload
) for you. - Easy Reset: To start over or re-configure the project name, simply delete the
publish.config.json
file.
- Git: Must be installed and available in your system's PATH. Download Git.
- GitHub CLI: Must be installed and authenticated.
- Download GitHub CLI.
- After installing, run
gh auth login
in your terminal to connect to your GitHub account.
- Clone Your Project: Make sure you are working inside a Git repository that has been cloned from GitHub.
git clone <your-repository-url> cd <your-repository-name>
- Place the Script: Copy the
Publish.ps1
script into the root directory of your cloned repository. - Run the Script: Open a PowerShell terminal in your repository's root directory and run the script.
.\Publish.ps1
- Follow the Prompts:
- The first time you run it, it will ask for a Project Name. This is used for naming the release
.zip
file. - It will then suggest a version number. You can press Enter to accept it or type a different one.
- Provide a commit message and release notes when prompted.
- The first time you run it, it will ask for a Project Name. This is used for naming the release
The script will handle the rest, leaving you with a new, formal release on your GitHub page.
If you need to change the project name or reset the versioning for any reason, simply delete the publish.config.json
file from your project's root directory. The script will re-initialize on its next run as if it were the first time.