96 lines
2.5 KiB
Markdown
96 lines
2.5 KiB
Markdown
# fullupgrade
|
|
|
|
Minimal Bash tools for Arch Linux maintenance and Git release automation.
|
|
|
|
## Overview
|
|
|
|
This repository contains two small Bash scripts:
|
|
|
|
- `fullupgrade`: updates an Arch Linux system and performs cleanup
|
|
- `makerelease.sh`: automates a Git release from `dev` to `main`
|
|
|
|
The project is intentionally small and focused on a simple, opinionated workflow.
|
|
|
|
## Requirements
|
|
|
|
- Bash
|
|
- `pacman` for `fullupgrade`
|
|
- `git` for `makerelease.sh`
|
|
- root privileges for `fullupgrade`
|
|
- a local Git repository with `dev` and `main` branches for `makerelease.sh`
|
|
|
|
## `fullupgrade`
|
|
|
|
`fullupgrade` performs the following steps:
|
|
|
|
1. updates `archlinux-keyring`
|
|
2. runs a full system synchronization with `pacman -Syu --noconfirm`
|
|
3. removes orphaned packages if any are found
|
|
4. cleans the pacman cache with `pacman -Sc --noconfirm`
|
|
|
|
### Usage
|
|
|
|
```bash
|
|
sudo ./fullupgrade
|
|
```
|
|
|
|
### Notes
|
|
|
|
- The script must be run as `root`.
|
|
- It does not ask for confirmation.
|
|
- It can remove packages and clean the package cache, so review the output carefully.
|
|
|
|
## `makerelease.sh`
|
|
|
|
`makerelease.sh` automates a Git release workflow:
|
|
|
|
1. checks that the current branch is `dev` for real releases
|
|
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
|
|
./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
|
|
```
|
|
|
|
### Examples
|
|
|
|
```bash
|
|
./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.
|
|
- `--dry-run` can be used from any branch and only prints the computed 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`.
|
|
- `makerelease.sh` now includes clean-tree checks, duplicate tag protection, increment shortcuts, dry-run support from any branch, and a trap to return to the original branch on exit.
|
|
|
|
## License
|
|
|
|
GPLv3
|