Repository navigation
235 lines (198 loc) Β· 7.44 KB
/
Copy pathci.yml
File metadata and controls
235 lines (198 loc) Β· 7.44 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
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --verbose
- name: Check formatting
run: cargo fmt -- --check
- name: Run clippy
run: cargo clippy -- -D warnings
build-nightly:
name: Build Nightly (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
name: ccline-88cc-nightly-linux-x64
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: ccline-88cc-nightly-linux-x64-static
- target: x86_64-pc-windows-msvc
os: windows-latest
name: ccline-88cc-nightly-windows-x64
- target: x86_64-apple-darwin
os: macos-latest
name: ccline-88cc-nightly-macos-x64
- target: aarch64-apple-darwin
os: macos-latest
name: ccline-88cc-nightly-macos-arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install musl tools
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build binary
run: cargo build --release --target ${{ matrix.target }}
- name: Package Linux/macOS
if: matrix.os != 'windows-latest'
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/ccline-88cc dist/ccline-88cc
cd dist
tar czf ../${{ matrix.name }}-${{ github.sha }}.tar.gz ccline-88cc
- name: Package Windows
if: matrix.os == 'windows-latest'
run: |
mkdir dist
copy "target\${{ matrix.target }}\release\ccline-88cc.exe" "dist\ccline-88cc.exe"
cd dist
7z a "..\${{ matrix.name }}-${{ github.sha }}.zip" ccline-88cc.exe
- name: Upload nightly build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-${{ github.sha }}
path: |
${{ matrix.name }}-${{ github.sha }}.tar.gz
${{ matrix.name }}-${{ github.sha }}.zip
retention-days: 30
build-summary:
name: Build Summary
runs-on: ubuntu-latest
needs: [test, build-nightly]
if: always()
steps:
- name: Print build summary
run: |
echo "## π Build Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "**Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [[ "${{ needs.test.result }}" == "success" ]]; then
echo "β
**Tests:** Passed" >> $GITHUB_STEP_SUMMARY
else
echo "β **Tests:** Failed" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ needs.build-nightly.result }}" == "success" ]]; then
echo "β
**Build:** All platforms built successfully" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### π¦ Nightly Builds Available:" >> $GITHUB_STEP_SUMMARY
echo "- Linux x64 (GNU libc)" >> $GITHUB_STEP_SUMMARY
echo "- Linux x64 (static/musl)" >> $GITHUB_STEP_SUMMARY
echo "- Windows x64" >> $GITHUB_STEP_SUMMARY
echo "- macOS x64 (Intel)" >> $GITHUB_STEP_SUMMARY
echo "- macOS ARM64 (Apple Silicon)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "π Download artifacts from the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
else
echo "β **Build:** Some platforms failed" >> $GITHUB_STEP_SUMMARY
fi
nightly-release:
name: Create Nightly Release
runs-on: ubuntu-latest
needs: [test, build-nightly]
if: github.ref == 'refs/heads/master' && needs.test.result == 'success' && needs.build-nightly.result == 'success'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: nightly-artifacts
- name: Generate release date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Generate nightly tag
id: tag
run: echo "tag=nightly-${{ steps.date.outputs.date }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Delete existing nightly releases
run: |
# Delete previous nightly releases (keep only the latest)
gh release list --json tagName,isDraft | jq -r '.[] | select(.tagName | startswith("nightly-")) | select(.isDraft == false) | .tagName' | head -n 5 | while read tag; do
echo "Deleting old nightly release: $tag"
gh release delete "$tag" --yes || true
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create nightly release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: "Nightly Build (${{ steps.date.outputs.date }})"
body: |
π **Nightly Build** - ${{ steps.date.outputs.date }}
**Commit:** ${{ github.sha }}
**Branch:** ${{ github.ref_name }}
**Build Time:** ${{ steps.date.outputs.date }}
## π¦ Available Downloads
### Linux
- **ccline-88cc-nightly-linux-x64**: Standard Linux x64 build (Ubuntu 22.04+)
- **ccline-88cc-nightly-linux-x64-static**: Static Linux x64 build (Universal compatibility)
### macOS
- **ccline-88cc-nightly-macos-x64**: Intel Mac build
- **ccline-88cc-nightly-macos-arm64**: Apple Silicon Mac build
### Windows
- **ccline-88cc-nightly-windows-x64**: Windows x64 build
## β οΈ Important Notes
- This is a **development build** from the latest `master` branch
- Use at your own risk - may contain bugs or incomplete features
- For stable releases, see the [Releases](https://github.com/${{ github.repository }}/releases) page
- Install via NPM: `npm install -g @byebyecode/ccline-88cc` (stable)
## π What's New
Recent commits in this build:
```
${{ github.event.head_commit.message }}
```
---
*Generated automatically from commit ${{ github.sha }}*
files: nightly-artifacts/*/*
draft: false
prerelease: true
make_latest: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}