Skip to content

Commit 3b3c90e

Browse files
committed
Update installation instructions in README.md to reference the latest release and enhance release process documentation in RELEASE.md to include GoReleaser details. Modify GitHub Actions workflow to utilize GoReleaser for automated releases.
1 parent 9913b78 commit 3b3c90e

File tree

4 files changed

+113
-136
lines changed

4 files changed

+113
-136
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -23,112 +23,11 @@ jobs:
2323
with:
2424
go-version: '1.25'
2525

26-
- name: Download dependencies
27-
run: |
28-
go mod download
29-
go mod tidy
30-
31-
- name: Extract version from tag
32-
id: version
33-
run: |
34-
# Remove 'v' prefix from tag name
35-
VERSION=${GITHUB_REF#refs/tags/v}
36-
echo "version=$VERSION" >> $GITHUB_OUTPUT
37-
echo "tag=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
38-
39-
- name: Build binaries
40-
run: |
41-
# Set version for build
42-
export VERSION=${{ steps.version.outputs.version }}
43-
make build-all
44-
45-
- name: Create checksums
46-
run: |
47-
cd build
48-
sha256sum pctl-* > checksums.txt
49-
cat checksums.txt
50-
51-
- name: Generate release notes
52-
id: release_notes
53-
run: |
54-
# Get the previous tag for changelog
55-
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
56-
57-
if [ -n "$PREVIOUS_TAG" ]; then
58-
echo "Generating release notes from $PREVIOUS_TAG to ${{ steps.version.outputs.tag }}"
59-
echo "## What's Changed" > release_notes.md
60-
echo "" >> release_notes.md
61-
62-
# Get commits between tags
63-
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..HEAD >> release_notes.md
64-
echo "" >> release_notes.md
65-
echo "**Full Changelog**: https://github.com/${{ github.repository }}/compare/$PREVIOUS_TAG...${{ steps.version.outputs.tag }}" >> release_notes.md
66-
else
67-
echo "No previous tag found, creating initial release notes"
68-
echo "## Initial Release" > release_notes.md
69-
echo "" >> release_notes.md
70-
echo "First release of pctl - Dev Companion for Portainer" >> release_notes.md
71-
fi
72-
73-
# Add installation instructions
74-
cat >> release_notes.md << 'EOF'
75-
76-
## Installation
77-
78-
Download the appropriate binary for your platform:
79-
80-
### Linux
81-
```bash
82-
# AMD64
83-
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/pctl-${{ steps.version.outputs.version }}-linux-amd64
84-
chmod +x pctl-${{ steps.version.outputs.version }}-linux-amd64
85-
sudo mv pctl-${{ steps.version.outputs.version }}-linux-amd64 /usr/local/bin/pctl
86-
87-
# ARM64
88-
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/pctl-${{ steps.version.outputs.version }}-linux-arm64
89-
chmod +x pctl-${{ steps.version.outputs.version }}-linux-arm64
90-
sudo mv pctl-${{ steps.version.outputs.version }}-linux-arm64 /usr/local/bin/pctl
91-
```
92-
93-
### macOS
94-
```bash
95-
# AMD64
96-
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/pctl-${{ steps.version.outputs.version }}-darwin-amd64
97-
chmod +x pctl-${{ steps.version.outputs.version }}-darwin-amd64
98-
sudo mv pctl-${{ steps.version.outputs.version }}-darwin-amd64 /usr/local/bin/pctl
99-
100-
# ARM64 (Apple Silicon)
101-
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/pctl-${{ steps.version.outputs.version }}-darwin-arm64
102-
chmod +x pctl-${{ steps.version.outputs.version }}-darwin-arm64
103-
sudo mv pctl-${{ steps.version.outputs.version }}-darwin-arm64 /usr/local/bin/pctl
104-
```
105-
106-
### Windows
107-
```bash
108-
# AMD64
109-
wget https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/pctl-${{ steps.version.outputs.version }}-windows-amd64.exe
110-
# Move pctl-${{ steps.version.outputs.version }}-windows-amd64.exe to your PATH and rename to pctl.exe
111-
```
112-
113-
### Verify Installation
114-
```bash
115-
pctl version
116-
```
117-
EOF
118-
119-
# Output the release notes
120-
cat release_notes.md
121-
122-
- name: Create Release
123-
uses: softprops/action-gh-release@v1
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v5
12428
with:
125-
tag_name: ${{ steps.version.outputs.tag }}
126-
name: Release ${{ steps.version.outputs.tag }}
127-
body_path: release_notes.md
128-
files: |
129-
build/pctl-*
130-
build/checksums.txt
131-
draft: false
132-
prerelease: false
29+
distribution: goreleaser
30+
version: latest
31+
args: release --clean
13332
env:
13433
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# GoReleaser configuration for pctl
2+
# See https://goreleaser.com/ for more information
3+
4+
# Project name and metadata
5+
project_name: pctl
6+
7+
# Build configuration
8+
builds:
9+
- id: pctl
10+
main: .
11+
binary: pctl
12+
goos:
13+
- linux
14+
- darwin
15+
- windows
16+
goarch:
17+
- amd64
18+
- arm64
19+
ldflags:
20+
- -s -w
21+
- -X github.com/deviantony/pctl/cmd/version.Version={{.Version}}
22+
- -X github.com/deviantony/pctl/cmd/version.Commit={{.Commit}}
23+
- -X github.com/deviantony/pctl/cmd/version.BuildTime={{.Date}}
24+
env:
25+
- CGO_ENABLED=0
26+
27+
# Archive configuration
28+
archives:
29+
- id: pctl
30+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
31+
format_overrides:
32+
- goos: windows
33+
format: zip
34+
files:
35+
- README.md
36+
- LICENSE
37+
- REQUIREMENTS.md
38+
format: tar.gz
39+
40+
# Checksums
41+
checksum:
42+
name_template: 'checksums.txt'
43+
algorithm: sha256
44+
45+
# Release configuration
46+
release:
47+
github:
48+
owner: deviantony
49+
name: pctl
50+
draft: false
51+
prerelease: auto
52+
mode: replace
53+
name_template: "Release {{ .Tag }}"
54+
header: |
55+
## What's Changed
56+
57+
{{ range .Commits -}}
58+
- {{ .Subject }} ({{ .Hash.Short }})
59+
{{ end }}
60+
61+
**Full Changelog**: https://github.com/{{ .Repo }}/compare/{{ .PreviousTag }}...{{ .Tag }}
62+
63+
# Changelog configuration
64+
changelog:
65+
sort: asc
66+
filters:
67+
exclude:
68+
- '^docs:'
69+
- '^test:'
70+
- '^ci:'
71+
- '^build:'
72+
- '^chore:'
73+
74+
# No additional package managers configured

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,46 +140,50 @@ When you run `pctl deploy`, it will:
140140

141141
## Installation
142142

143-
Download the latest release for your platform from [GitHub Releases](https://github.com/deviantony/pctl/releases/tag/v1.1.1):
143+
Download the latest release for your platform from [GitHub Releases](https://github.com/deviantony/pctl/releases/latest):
144144

145145
### Linux
146146
```bash
147147
# AMD64
148-
wget https://github.com/deviantony/pctl/releases/download/v1.1.1/pctl_1.1.1_linux_amd64
149-
chmod +x pctl_1.1.1_linux_amd64
150-
sudo mv pctl_1.1.1_linux_amd64 /usr/local/bin/pctl
148+
wget https://github.com/deviantony/pctl/releases/latest/download/pctl_1.2.0_linux_amd64.tar.gz
149+
tar -xzf pctl_1.2.0_linux_amd64.tar.gz
150+
chmod +x pctl
151+
sudo mv pctl /usr/local/bin/
151152
152153
# ARM64
153-
wget https://github.com/deviantony/pctl/releases/download/v1.1.1/pctl_1.1.1_linux_arm64
154-
chmod +x pctl_1.1.1_linux_arm64
155-
sudo mv pctl_1.1.1_linux_arm64 /usr/local/bin/pctl
154+
wget https://github.com/deviantony/pctl/releases/latest/download/pctl_1.2.0_linux_arm64.tar.gz
155+
tar -xzf pctl_1.2.0_linux_arm64.tar.gz
156+
chmod +x pctl
157+
sudo mv pctl /usr/local/bin/
156158
```
157159

158160
### macOS
159161
```bash
160162
# AMD64
161-
wget https://github.com/deviantony/pctl/releases/download/v1.1.1/pctl_1.1.1_darwin_amd64
162-
chmod +x pctl_1.1.1_darwin_amd64
163-
sudo mv pctl_1.1.1_darwin_amd64 /usr/local/bin/pctl
163+
wget https://github.com/deviantony/pctl/releases/latest/download/pctl_1.2.0_darwin_amd64.tar.gz
164+
tar -xzf pctl_1.2.0_darwin_amd64.tar.gz
165+
chmod +x pctl
166+
sudo mv pctl /usr/local/bin/
164167
165168
# ARM64 (Apple Silicon)
166-
wget https://github.com/deviantony/pctl/releases/download/v1.1.1/pctl_1.1.1_darwin_arm64
167-
chmod +x pctl_1.1.1_darwin_arm64
168-
sudo mv pctl_1.1.1_darwin_arm64 /usr/local/bin/pctl
169+
wget https://github.com/deviantony/pctl/releases/latest/download/pctl_1.2.0_darwin_arm64.tar.gz
170+
tar -xzf pctl_1.2.0_darwin_arm64.tar.gz
171+
chmod +x pctl
172+
sudo mv pctl /usr/local/bin/
169173
```
170174

171175
### Windows
172176
```bash
173177
# AMD64
174-
wget https://github.com/deviantony/pctl/releases/download/v1.1.1/pctl_1.1.1_windows_amd64.exe
175-
# Move pctl_1.1.1_windows_amd64.exe to your PATH and rename to pctl.exe
178+
wget https://github.com/deviantony/pctl/releases/latest/download/pctl_1.2.0_windows_amd64.zip
179+
# Extract the zip file and move pctl.exe to your PATH
176180
```
177181

178182
## Development
179183

180184
### Creating Releases
181185

182-
Releases are automated using GitHub Actions. To create a new release:
186+
Releases are automated using [GoReleaser](https://goreleaser.com/) and GitHub Actions. To create a new release:
183187

184188
```bash
185189
# Create a new release (e.g., version 1.2.0)
@@ -192,8 +196,8 @@ Releases are automated using GitHub Actions. To create a new release:
192196
This will:
193197
1. Create a git tag `v1.2.0`
194198
2. Push the tag to GitHub
195-
3. Automatically build binaries for all platforms
196-
4. Create a GitHub release with all binaries and release notes
199+
3. GoReleaser automatically builds binaries for all platforms
200+
4. Creates a GitHub release with all binaries, checksums, and release notes
197201

198202
See [RELEASE.md](RELEASE.md) for detailed release process documentation.
199203

RELEASE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release Process
22

3-
This document explains how to create new releases for pctl using the automated GitHub Actions workflow.
3+
This document explains how to create new releases for pctl using [GoReleaser](https://goreleaser.com/) and automated GitHub Actions.
44

55
## Quick Start
66

@@ -13,7 +13,7 @@ To create a new release, simply run:
1313
This will:
1414
1. Create a git tag `v1.2.0`
1515
2. Push the tag to GitHub
16-
3. Trigger the automated release workflow
16+
3. Trigger the automated GoReleaser workflow
1717
4. Build binaries for all platforms
1818
5. Create a GitHub release with all binaries and release notes
1919

@@ -25,24 +25,24 @@ This will:
2525

2626
## Release Workflow
2727

28-
The automated release process includes:
28+
The automated release process uses [GoReleaser](https://goreleaser.com/) and includes:
2929

3030
### 1. Build Process
31-
- Builds binaries for multiple platforms:
32-
- Linux AMD64 (`pctl-linux-amd64`)
33-
- Linux ARM64 (`pctl-linux-arm64`)
34-
- macOS AMD64 (`pctl-darwin-amd64`)
35-
- macOS ARM64 (`pctl-darwin-arm64`)
36-
- Windows AMD64 (`pctl-windows-amd64.exe`)
31+
GoReleaser builds binaries for multiple platforms:
32+
- Linux AMD64 (`pctl_linux_amd64`)
33+
- Linux ARM64 (`pctl_linux_arm64`)
34+
- macOS AMD64 (`pctl_darwin_amd64`)
35+
- macOS ARM64 (`pctl_darwin_arm64`)
36+
- Windows AMD64 (`pctl_windows_amd64.exe`)
3737

3838
### 2. Release Creation
3939
- Creates a GitHub release with the tag name
4040
- Generates automatic release notes from git commits
41-
- Uploads all built binaries
42-
- Creates and uploads checksums file
41+
- Uploads all built binaries and archives
42+
- Creates and uploads SHA256 checksums
4343

4444
### 3. Release Notes
45-
The workflow automatically generates release notes including:
45+
GoReleaser automatically generates release notes including:
4646
- List of commits since the last release
4747
- Installation instructions for all platforms
4848
- Link to the full changelog

0 commit comments

Comments
 (0)