This repository was archived by the owner on Oct 2, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
288 lines (260 loc) · 10.3 KB
/
Copy pathrelease.yml
File metadata and controls
288 lines (260 loc) · 10.3 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary_name: nitroterm
asset_name: nitroterm-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
binary_name: nitroterm.exe
asset_name: nitroterm-windows-x86_64.exe
- os: macos-13 # Intel macOS
target: x86_64-apple-darwin
binary_name: nitroterm
asset_name: nitroterm-macos-x86_64
- os: macos-14 # Apple Silicon macOS (M1/M2)
target: aarch64-apple-darwin
binary_name: nitroterm
asset_name: nitroterm-macos-arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install build dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.target }}-cargo-
- name: Build release
run: cargo build --release --target ${{ matrix.target }}
- name: Debug build output
shell: bash
run: |
echo "=== Target directory ==="
ls -la target/${{ matrix.target }}/release/ || echo "Release directory not found"
echo "=== Looking for binary ==="
find target -name "${{ matrix.binary_name }}" -type f
- name: Debug Windows build (Windows only)
if: matrix.os == 'windows-latest'
shell: powershell
run: |
Write-Host "=== Checking build script execution ==="
if (Test-Path "src\icon.ico") {
Write-Host "✅ Icon file exists: src\icon.ico"
Get-Item "src\icon.ico" | Select-Object Name, Length
} else {
Write-Host "❌ Icon file missing: src\icon.ico"
}
Write-Host "=== Checking binary properties ==="
if (Test-Path "target\${{ matrix.target }}\release\${{ matrix.binary_name }}") {
$file = Get-Item "target\${{ matrix.target }}\release\${{ matrix.binary_name }}"
Write-Host "Binary size: $($file.Length) bytes"
# Version info kontrolü
$versionInfo = $file.VersionInfo
if ($versionInfo) {
Write-Host "✅ Version info found:"
Write-Host " Product Name: $($versionInfo.ProductName)"
Write-Host " File Description: $($versionInfo.FileDescription)"
Write-Host " File Version: $($versionInfo.FileVersion)"
} else {
Write-Host "❌ No version info found"
}
}
- name: Prepare binary (Unix)
if: matrix.os != 'windows-latest'
run: |
if [ -f "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" ]; then
cp "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "${{ matrix.asset_name }}"
chmod +x "${{ matrix.asset_name }}"
echo "✅ Binary prepared: ${{ matrix.asset_name }}"
ls -la "${{ matrix.asset_name }}"
else
echo "❌ Binary not found at: target/${{ matrix.target }}/release/${{ matrix.binary_name }}"
exit 1
fi
- name: Prepare binary (Windows)
if: matrix.os == 'windows-latest'
run: |
if (Test-Path "target\${{ matrix.target }}\release\${{ matrix.binary_name }}") {
Copy-Item "target\${{ matrix.target }}\release\${{ matrix.binary_name }}" "${{ matrix.asset_name }}"
Write-Host "✅ Binary prepared: ${{ matrix.asset_name }}"
Get-Item "${{ matrix.asset_name }}"
} else {
Write-Host "❌ Binary not found at: target\${{ matrix.target }}\release\${{ matrix.binary_name }}"
exit 1
}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
if-no-files-found: error
retention-days: 1
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Debug artifact structure
run: |
echo "=== Complete artifacts structure ==="
find artifacts -type f | sort
echo ""
echo "=== Artifact subdirectories ==="
ls -la artifacts/
- name: Move artifacts correctly
run: |
echo "=== Moving artifacts from subdirectories ==="
for dir in artifacts/*/; do
if [ -d "$dir" ]; then
echo "Processing directory: $dir"
# Her subdirectory'den dosyaları root'a taşı
find "$dir" -type f -name "nitroterm-*" -exec mv {} . \;
fi
done
echo "=== Files after move ==="
ls -la nitroterm-* 2>/dev/null || echo "No nitroterm files found after move"
- name: Verify artifacts exist
run: |
REQUIRED_FILES=(
"nitroterm-linux-x86_64"
"nitroterm-windows-x86_64.exe"
"nitroterm-macos-x86_64"
"nitroterm-macos-arm64"
)
MISSING_FILES=()
for file in "${REQUIRED_FILES[@]}"; do
if [ ! -f "$file" ]; then
MISSING_FILES+=("$file")
fi
done
if [ ${#MISSING_FILES[@]} -ne 0 ]; then
echo "❌ Missing files: ${MISSING_FILES[*]}"
echo "Available files:"
ls -la
echo "Searching for any nitroterm files:"
find . -name "*nitroterm*" -type f
exit 1
else
echo "✅ All required files found"
ls -la nitroterm-*
fi
- name: Generate release notes
id: release_notes
run: |
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
{
echo "RELEASE_NOTES<<EOF"
echo "## 🚀 What's New in ${{ github.ref_name }}"
echo ""
if [ -n "$PREVIOUS_TAG" ]; then
echo "### 📝 Changes since $PREVIOUS_TAG"
git log $PREVIOUS_TAG..HEAD --pretty=format:"- %s" --no-merges | head -20
else
echo "### 📝 Initial Release"
git log --pretty=format:"- %s" --no-merges | head -10
fi
echo ""
echo ""
echo "## 📥 Downloads"
echo ""
echo "| Platform | Download |"
echo "|----------|----------|"
echo "| Windows (x64) | [\`nitroterm-windows-x86_64.exe\`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/nitroterm-windows-x86_64.exe) |"
echo "| macOS (Intel) | [\`nitroterm-macos-x86_64\`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/nitroterm-macos-x86_64) |"
echo "| macOS (Apple Silicon) | [\`nitroterm-macos-arm64\`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/nitroterm-macos-arm64) |"
echo "| Linux (x64) | [\`nitroterm-linux-x86_64\`](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/nitroterm-linux-x86_64) |"
echo ""
echo "## 🛠️ Installation"
echo ""
echo "### Manual Download"
echo "\`\`\`bash"
echo "# Linux/macOS"
echo "wget https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/nitroterm-\$(uname -s | tr '[:upper:]' '[:lower:]')-\$(uname -m)"
echo "chmod +x nitroterm-*"
echo "sudo mv nitroterm-* /usr/local/bin/nitroterm"
echo "\`\`\`"
echo ""
echo "### Using Cargo"
echo "\`\`\`bash"
echo "cargo install nitroterm"
echo "\`\`\`"
echo ""
echo "## 🚀 Usage"
echo ""
echo "\`\`\`bash"
echo "# Interactive mode"
echo "nitroterm"
echo ""
echo "# Direct commands"
echo "nitroterm release-notes"
echo "nitroterm create-release patch"
echo "nitroterm sync-translations"
echo "\`\`\`"
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "🚀 Nitroterm ${{ github.ref_name }}"
body: ${{ steps.release_notes.outputs.RELEASE_NOTES }}
draft: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
files: |
nitroterm-linux-x86_64
nitroterm-windows-x86_64.exe
nitroterm-macos-x86_64
nitroterm-macos-arm64
generate_release_notes: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
name: Publish to crates.io
needs: [build, release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'rc')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
continue-on-error: true