-
-
Notifications
You must be signed in to change notification settings - Fork 1
175 lines (140 loc) · 5.68 KB
/
release.yml
File metadata and controls
175 lines (140 loc) · 5.68 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Release
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags like v1.0.0
permissions:
contents: write
jobs:
build:
name: Build Release Binaries
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: linux
arch: amd64
name: defenra-agent-linux-amd64
- os: linux
arch: arm64
name: defenra-agent-linux-arm64
- os: darwin
arch: amd64
name: defenra-agent-darwin-amd64
- os: darwin
arch: arm64
name: defenra-agent-darwin-arm64
- os: freebsd
arch: amd64
name: defenra-agent-freebsd-amd64
- os: freebsd
arch: arm64
name: defenra-agent-freebsd-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Download dependencies
run: go mod download
- name: Build binary
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 0
run: |
go build -ldflags "-s -w -X main.Version=${{ steps.get_version.outputs.VERSION }} -X main.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X main.GitCommit=${GITHUB_SHA::8}" -o ${{ matrix.name }} .
- name: Compress binary
run: |
tar -czf ${{ matrix.name }}.tar.gz ${{ matrix.name }}
sha256sum ${{ matrix.name }}.tar.gz > ${{ matrix.name }}.tar.gz.sha256
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: |
${{ matrix.name }}.tar.gz
${{ matrix.name }}.tar.gz.sha256
create-release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version from tag
id: get_version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "VERSION_NUMBER=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: defenra-agent-*
merge-multiple: true
- name: Prepare release assets
run: |
mkdir -p release
find artifacts -name "*.tar.gz*" -exec cp {} release/ \;
ls -lah release/
- name: Generate release notes
id: release_notes
run: |
cat > RELEASE_NOTES.md << 'EOF'
## Defenra Agent ${{ steps.get_version.outputs.VERSION }}
### 🚀 Installation
**Quick Install (Linux):**
```bash
curl -sSL https://raw.githubusercontent.com/Defenra/DefenraAgent/main/install.sh | sudo bash
```
**Manual Download:**
- [Linux AMD64](https://github.com/Defenra/DefenraAgent/releases/download/${{ steps.get_version.outputs.VERSION }}/defenra-agent-linux-amd64.tar.gz)
- [Linux ARM64](https://github.com/Defenra/DefenraAgent/releases/download/${{ steps.get_version.outputs.VERSION }}/defenra-agent-linux-arm64.tar.gz)
- [macOS AMD64](https://github.com/Defenra/DefenraAgent/releases/download/${{ steps.get_version.outputs.VERSION }}/defenra-agent-darwin-amd64.tar.gz)
- [macOS ARM64 (M1/M2)](https://github.com/Defenra/DefenraAgent/releases/download/${{ steps.get_version.outputs.VERSION }}/defenra-agent-darwin-arm64.tar.gz)
### 📦 What's Included
- **GeoDNS Server** - DNS with geographic routing
- **HTTP/HTTPS Reverse Proxy** - With SSL termination
- **Lua WAF** - Web Application Firewall
- **TCP/UDP Proxy** - Port forwarding
### 🔧 System Requirements
- Linux or macOS
- x86_64 (AMD64) or ARM64 architecture
- Ports: 53, 80, 443, 8080
### 📝 Verification
Verify checksums after download:
```bash
sha256sum -c defenra-agent-linux-amd64.tar.gz.sha256
```
### 📚 Documentation
- [Installation Guide](https://github.com/Defenra/DefenraAgent/blob/main/INSTALL_GUIDE.md)
- [Quick Start](https://github.com/Defenra/DefenraAgent/blob/main/QUICKSTART.md)
- [Architecture](https://github.com/Defenra/DefenraAgent/blob/main/ARCHITECTURE.md)
### 🐛 Bug Reports
Report issues at: https://github.com/Defenra/DefenraAgent/issues
---
**Full Changelog:** [${{ steps.get_version.outputs.VERSION }}](https://github.com/Defenra/DefenraAgent/blob/${{ steps.get_version.outputs.VERSION }}/CHANGELOG.md)
EOF
cat RELEASE_NOTES.md
- name: Create Release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ steps.get_version.outputs.VERSION }}
body_path: RELEASE_NOTES.md
files: release/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update latest tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -f latest
git push -f origin latest