feat: enhance makerelease workflow with dry-run and increments
This commit is contained in:
@@ -7,7 +7,7 @@ Minimal Bash tools for Arch Linux maintenance and Git release automation.
|
||||
This repository contains two small Bash scripts:
|
||||
|
||||
- `fullupgrade`: updates an Arch Linux system and performs cleanup
|
||||
- `makerelease.sh`: merges `dev` into `main` and creates a release tag
|
||||
- `makerelease.sh`: automates a Git release from `dev` to `main`
|
||||
|
||||
The project is intentionally small and focused on a simple, opinionated workflow.
|
||||
|
||||
@@ -42,37 +42,52 @@ sudo ./fullupgrade
|
||||
|
||||
## `makerelease.sh`
|
||||
|
||||
`makerelease.sh` automates a simple Git release workflow:
|
||||
`makerelease.sh` automates a Git release workflow:
|
||||
|
||||
1. checks that the current branch is `dev`
|
||||
2. switches to `main`
|
||||
3. merges `dev` into `main`
|
||||
4. pushes `main`
|
||||
5. creates an annotated tag using the provided version and message
|
||||
6. pushes tags
|
||||
7. switches back to `dev`
|
||||
2. verifies the working tree is clean
|
||||
3. optionally computes a new version from an increment shortcut
|
||||
4. switches to `main`
|
||||
5. merges `dev` into `main`
|
||||
6. pushes `main`
|
||||
7. creates an annotated tag
|
||||
8. pushes tags
|
||||
9. switches back to the original branch on exit
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
./makerelease.sh VERSION "Release message"
|
||||
./makerelease.sh VERSION
|
||||
./makerelease.sh +0.0.1
|
||||
./makerelease.sh +0.1
|
||||
./makerelease.sh +1
|
||||
./makerelease.sh --dry-run VERSION
|
||||
./makerelease.sh --dry-run +0.0.1
|
||||
./makerelease.sh --dry-run +0.1
|
||||
./makerelease.sh --dry-run +1
|
||||
```
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
./makerelease.sh 1.2.0 "Release 1.2.0"
|
||||
./makerelease.sh 1.2.0
|
||||
./makerelease.sh --dry-run +0.0.1
|
||||
```
|
||||
|
||||
### Notes
|
||||
|
||||
- Run the script from a clean, local Git repository.
|
||||
- Make sure the `dev` branch contains the changes you want to release.
|
||||
- `VERSION` is used directly as the tag name.
|
||||
- If `VERSION` starts with `+`, it is treated as an increment based on the latest existing tag.
|
||||
- The script may fail if Git state is unexpected or if a tag already exists.
|
||||
- The tag message is automatically generated as `Release <version>`.
|
||||
|
||||
## Status
|
||||
|
||||
This repository is intentionally minimal. `fullupgrade` is hardened with `set -euo pipefail`, while `makerelease.sh` may still need additional validation and safeguards.
|
||||
This repository is intentionally minimal.
|
||||
- `fullupgrade` is hardened with `set -euo pipefail`.
|
||||
- `makerelease.sh` now includes clean-tree checks, duplicate tag protection, increment shortcuts, dry-run support, and a trap to return to the original branch on exit.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user