-
-
Notifications
You must be signed in to change notification settings - Fork 3
127 lines (105 loc) · 4.19 KB
/
Copy pathrelease.yml
File metadata and controls
127 lines (105 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Build and publish SMART Sniffer Agent binaries on tagged releases.
#
# Trigger: push a tag like v0.1.0
# git tag v0.1.0
# git push origin v0.1.0
#
# The workflow:
# 1. Checks out the code
# 2. Cross-compiles for all supported platforms
# 3. Generates SHA256 checksums
# 4. Creates a GitHub Release with all artifacts attached
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: agent/go.mod
cache-dependency-path: agent/go.sum
- name: Vet Go
working-directory: agent
run: go vet ./...
- name: Lint Python
run: |
pip install ruff
ruff check custom_components/
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- name: Build all platforms
working-directory: agent
run: make all VERSION=${{ steps.version.outputs.VERSION }}
- name: Generate checksums
working-directory: agent/build
run: |
sha256sum smartha-agent-* > checksums.txt
cat checksums.txt
- name: Extract changelog for this version
id: changelog
run: |
# Extract the section for the current version from CHANGELOG.md.
# Grabs everything between the first "## v*" heading and the next one.
NOTES=$(awk '
/^## v/ { if (found) exit; found=1; next }
found { print }
' CHANGELOG.md)
# Write to a step output using a heredoc delimiter to preserve newlines.
{
echo "NOTES<<CHANGELOG_EOF"
echo "$NOTES"
echo "CHANGELOG_EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: SMART Sniffer v${{ steps.version.outputs.VERSION }}
# Auto-flag any tag with -rc, -beta, or -alpha as a pre-release
# so GitHub's "latest release" endpoint skips it. install.sh and
# install.ps1 both call that endpoint for version discovery; if
# an rc were marked latest, every user running the install one-
# liner without pinning VERSION would be pulled onto an rc.
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
body: |
${{ steps.changelog.outputs.NOTES }}
📋 [Full Changelog](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md)
---
### ⚡ Update Your Agents
**Already have agents running?** Update them to match this release:
```bash
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | sudo bash
```
The installer detects your existing configuration and offers to keep it — just press Enter to upgrade in place.
---
### Fresh Install
**Linux / macOS (one command):**
```bash
curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | sudo bash
```
**Windows (PowerShell as Admin):**
```powershell
irm https://raw.githubusercontent.com/${{ github.repository }}/main/install.ps1 | iex
```
### Manual Download
Download the binary for your platform below, then see the [README](https://github.com/${{ github.repository }}#installation) for manual installation instructions.
### Checksums
Verify your download with `sha256sum -c checksums.txt`.
files: |
agent/build/smartha-agent-linux-amd64
agent/build/smartha-agent-linux-arm64
agent/build/smartha-agent-linux-arm
agent/build/smartha-agent-darwin-amd64
agent/build/smartha-agent-darwin-arm64
agent/build/smartha-agent-windows-amd64.exe
agent/build/checksums.txt
generate_release_notes: true