You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve release process with tag checks and confirmations
Adds interactive prompts for tag management, version file updates,
and GitHub release deployment. Includes documentation for required
environment variables and GPG signing setup.
Copy file name to clipboardExpand all lines: README.md
+114Lines changed: 114 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,120 @@ I could not introduce opaque security issues into binary releases.
38
38
In the meantime, I certify by my professional reputation and career as:
39
39
https://www.linkedin.com/in/zph/ that appropriate safeguards are being taken.
40
40
41
+
## Release Process
42
+
43
+
The release process is automated through the `make release` command, which handles tag management, version file updates, GitHub releases, and pushing changes.
44
+
45
+
### Prerequisites
46
+
47
+
Before running the release process, ensure you have the following set up:
48
+
49
+
1.**GPG Key for Signing**: A GPG key must be configured for signing release artifacts.
50
+
- Set the `GPG_FINGERPRINT` environment variable to your GPG key fingerprint:
51
+
```bash
52
+
export GPG_FINGERPRINT="your-gpg-key-fingerprint"
53
+
```
54
+
- To find your GPG key fingerprint:
55
+
```bash
56
+
gpg --list-secret-keys --keyid-format LONG
57
+
```
58
+
- The fingerprint is the long string after the key type (e.g., `RSA 4096/ABC123DEF456...`)
59
+
60
+
2. **GitHub Authentication**: You need authentication configured for pushing to GitHub.
61
+
- Either configure SSH keys for git push, or
62
+
- Set up a GitHub Personal Access Token with appropriate permissions
63
+
- goreleaser will use `GITHUB_TOKEN` environment variable if set, otherwise it will use git credentials
64
+
65
+
3. **Required Tools**:
66
+
- `goreleaser` - Install from https://goreleaser.com/install/
67
+
- `git` - For version control operations
68
+
- `make` - For running the release command
69
+
70
+
### Release Workflow
71
+
72
+
The `make release`command performs the following steps:
73
+
74
+
1. **Version Check**: Reads the current version from the `VERSION` file and checks if a tag for that version already exists.
75
+
76
+
2. **Tag Management**:
77
+
- If the tag already exists, it automatically suggests the next version by incrementing the build number (e.g., `v3.0.62006` → `v3.0.62007`)
78
+
- You can accept the suggestion or enter a custom tag
79
+
- If the tag doesn't exist, it uses the version from the `VERSION` file
80
+
81
+
3. **Version File Update**: If a new version was determined, the `VERSION` file is automatically updated with the new version number.
82
+
83
+
4. **Confirmation Prompts**: The process includes interactive confirmations at key steps:
84
+
- Confirmation to create and tag the release
85
+
- Confirmation to deploy as a GitHub release
86
+
- Confirmation to push tags and commits to GitHub
87
+
88
+
5. **Tag Creation**: Creates an annotated git tag with the version number.
89
+
90
+
6. **Version File Commit**: If the `VERSION` file was modified, it commits the change with message "Update VERSION to {version}".
91
+
92
+
7. **GitHub Release**: Uses `goreleaser` to:
93
+
- Build binaries for all supported platforms (Linux, macOS, Windows, FreeBSD)
94
+
- Create archives (zip files) for each platform/architecture combination
95
+
- Generate SHA256 checksums
96
+
- Sign the checksum file with your GPG key
97
+
- Create a draft GitHub release (you can publish it manually after review)
98
+
99
+
8. **Push to GitHub**: Pushes the tag and commits to the remote repository.
100
+
101
+
### Usage
102
+
103
+
To create a release, simply run:
104
+
105
+
```bash
106
+
make release
107
+
```
108
+
109
+
The process will guide you through each step with clear prompts. You can cancel at any point if needed.
110
+
111
+
### Example Release Session
112
+
113
+
```bash
114
+
$ make release
115
+
Checking if tag v3.0.62006 already exists...
116
+
Tag v3.0.62006 already exists!
117
+
Current version from VERSION file: 3.0.62006
118
+
Most recent tag: v3.0.62006 (version: 3.0.62006)
119
+
120
+
Suggested next tag: v3.0.62007
121
+
Enter next tag (or press Enter to use v3.0.62007):
122
+
123
+
Updating VERSION file from 3.0.62006 to 3.0.62007...
124
+
VERSION file updated.
125
+
126
+
=========================================
127
+
Release Summary:
128
+
Tag: v3.0.62007
129
+
Version: 3.0.62007
130
+
=========================================
131
+
132
+
Do you want to create tag v3.0.62007? (yes/no): yes
133
+
134
+
Creating tag v3.0.62007...
135
+
VERSION file change committed.
136
+
Tag v3.0.62007 created successfully.
137
+
138
+
Do you want to deploy this as a GitHub release? (yes/no): yes
139
+
140
+
Running goreleaser to create GitHub release...
141
+
[... goreleaser output ...]
142
+
143
+
Do you want to push tags and commits to GitHub? (yes/no): yes
144
+
145
+
Pushing to GitHub...
146
+
Release complete! Tag v3.0.62007 has been pushed to GitHub.
147
+
```
148
+
149
+
### Troubleshooting
150
+
151
+
- **GPG signing fails**: Ensure `GPG_FINGERPRINT` is set correctly and your GPG key is available in your keyring
152
+
- **GitHub push fails**: Check your git credentials or SSH keys are configured correctly
153
+
- **goreleaser fails**: Ensure you have the latest version of goreleaser installed and check the `.goreleaser.yml` configuration
0 commit comments