Skip to content

Commit 9ebd81c

Browse files
Sridharankrsri
authored andcommitted
Adding go releaser
1 parent f424f69 commit 9ebd81c

2 files changed

Lines changed: 104 additions & 0 deletions

File tree

.goreleaser.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
project_name: go-pivnet
2+
3+
builds:
4+
- skip: true
5+
6+
changelog:
7+
sort: asc
8+
filters:
9+
exclude:
10+
- '^docs:'
11+
- '^test:'
12+
- '^chore:'
13+
14+
release:
15+
github:
16+
owner: pivotal-cf
17+
name: go-pivnet
18+
draft: true
19+

RELEASE.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Release Process
2+
3+
This document describes how to create a new release for go-pivnet.
4+
5+
## Prerequisites
6+
7+
1. Install [goreleaser](https://goreleaser.com/install/):
8+
```bash
9+
brew install goreleaser
10+
# or
11+
go install github.com/goreleaser/goreleaser@latest
12+
```
13+
14+
2. Ensure you have a GitHub token with appropriate permissions set:
15+
```bash
16+
export GITHUB_TOKEN=your_github_token
17+
```
18+
19+
## Creating a Release
20+
21+
### 1. Create and Push a Git Tag
22+
23+
Create a new tag following semantic versioning (e.g., `v7.1.0`):
24+
25+
```bash
26+
# Create an annotated tag
27+
git tag -a v7.1.0 -m "Release v7.1.0"
28+
29+
# Push the tag to GitHub
30+
git push origin v7.1.0
31+
```
32+
33+
Or create a tag from the GitHub UI when creating a release.
34+
35+
### 2. Run GoReleaser
36+
37+
Run goreleaser to create the release:
38+
39+
```bash
40+
goreleaser release
41+
```
42+
43+
This will:
44+
- Generate a changelog from git commits
45+
- Create a draft GitHub release
46+
- Upload any build artifacts (if builds are configured)
47+
48+
### 3. Review and Publish
49+
50+
1. Go to the [GitHub releases page](https://github.com/pivotal-cf/go-pivnet/releases)
51+
2. Review the draft release
52+
3. Edit the release notes if needed
53+
4. Click "Publish release" when ready
54+
55+
## Dry Run (Testing)
56+
57+
To test the release process without actually creating a release:
58+
59+
```bash
60+
goreleaser release --snapshot
61+
```
62+
63+
This creates a snapshot release that won't be published to GitHub.
64+
65+
**What happens with `--snapshot`:**
66+
- Creates local artifacts in the `dist/` folder
67+
- Does **NOT** create a GitHub release
68+
- Useful for testing the release process locally
69+
70+
**To check snapshot results:**
71+
- Look in the `dist/` folder for generated files
72+
- Check `dist/metadata.json` for release metadata
73+
- Since builds are skipped for this library, the folder will mainly contain metadata files
74+
75+
**To create an actual release on GitHub:**
76+
- Run `goreleaser release` (without `--snapshot`)
77+
- Then check: https://github.com/pivotal-cf/go-pivnet/releases
78+
- The release will appear as a **draft** that you can review and publish
79+
80+
## Notes
81+
82+
- Releases are created as **drafts** by default, so you can review before publishing
83+
- The changelog automatically excludes commits starting with `docs:`, `test:`, and `chore:`
84+
- Make sure your git tags follow semantic versioning (e.g., `v7.1.0`, `v7.2.0`)
85+

0 commit comments

Comments
 (0)