Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 183 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0

jobs:
test:
Expand Down Expand Up @@ -40,18 +42,194 @@ jobs:
- name: Run clippy
run: cargo clippy -- -D warnings

build:
name: Build Check
build-nightly:
name: Build Nightly (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
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 }}
```

- name: Build
run: cargo build --release
---
*Generated automatically from commit ${{ github.sha }}*
files: nightly-artifacts/*/*
draft: false
prerelease: true
make_latest: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72 changes: 36 additions & 36 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-22.04
name: ccline-linux-x64.tar.gz
name: ccline-88cc-linux-x64.tar.gz
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
name: ccline-linux-x64-static.tar.gz
name: ccline-88cc-linux-x64-static.tar.gz
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
name: ccline-windows-x64.zip
name: ccline-88cc-windows-x64.zip
- target: x86_64-apple-darwin
os: macos-latest
name: ccline-macos-x64.tar.gz
name: ccline-88cc-macos-x64.tar.gz
- target: aarch64-apple-darwin
os: macos-latest
name: ccline-macos-arm64.tar.gz
name: ccline-88cc-macos-arm64.tar.gz

steps:
- name: Checkout
Expand Down Expand Up @@ -60,17 +60,17 @@ jobs:
if: matrix.os != 'windows-latest' && matrix.target != 'x86_64-pc-windows-gnu'
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/ccometixline dist/ccline
cp target/${{ matrix.target }}/release/ccline-88cc dist/ccline-88cc
cd dist
tar czf ../${{ matrix.name }} ccline
tar czf ../${{ matrix.name }} ccline-88cc

- name: Package Windows
if: matrix.target == 'x86_64-pc-windows-gnu'
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/ccometixline.exe dist/ccline.exe
cp target/${{ matrix.target }}/release/ccline-88cc.exe dist/ccline-88cc.exe
cd dist
zip ../${{ matrix.name }} ccline.exe
zip ../${{ matrix.name }} ccline-88cc.exe

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -111,24 +111,24 @@ jobs:
mkdir -p extracted

# macOS x64
tar -xzf artifacts/ccline-macos-x64.tar.gz/ccline-macos-x64.tar.gz -C extracted
mv extracted/ccline extracted/ccline-darwin-x64
tar -xzf artifacts/ccline-88cc-macos-x64.tar.gz/ccline-88cc-macos-x64.tar.gz -C extracted
mv extracted/ccline-88cc extracted/ccline-88cc-darwin-x64

# macOS ARM64
tar -xzf artifacts/ccline-macos-arm64.tar.gz/ccline-macos-arm64.tar.gz -C extracted
mv extracted/ccline extracted/ccline-darwin-arm64
tar -xzf artifacts/ccline-88cc-macos-arm64.tar.gz/ccline-88cc-macos-arm64.tar.gz -C extracted
mv extracted/ccline-88cc extracted/ccline-88cc-darwin-arm64

# Linux x64
tar -xzf artifacts/ccline-linux-x64.tar.gz/ccline-linux-x64.tar.gz -C extracted
mv extracted/ccline extracted/ccline-linux-x64
tar -xzf artifacts/ccline-88cc-linux-x64.tar.gz/ccline-88cc-linux-x64.tar.gz -C extracted
mv extracted/ccline-88cc extracted/ccline-88cc-linux-x64

# Linux musl (static)
tar -xzf artifacts/ccline-linux-x64-static.tar.gz/ccline-linux-x64-static.tar.gz -C extracted
mv extracted/ccline extracted/ccline-linux-x64-musl
tar -xzf artifacts/ccline-88cc-linux-x64-static.tar.gz/ccline-88cc-linux-x64-static.tar.gz -C extracted
mv extracted/ccline-88cc extracted/ccline-88cc-linux-x64-musl

# Windows
unzip artifacts/ccline-windows-x64.zip/ccline-windows-x64.zip -d extracted
mv extracted/ccline.exe extracted/ccline-win32-x64.exe
unzip artifacts/ccline-88cc-windows-x64.zip/ccline-88cc-windows-x64.zip -d extracted
mv extracted/ccline-88cc.exe extracted/ccline-88cc-win32-x64.exe

# List extracted files
ls -la extracted/
Expand All @@ -137,20 +137,20 @@ jobs:
run: |
# Prepare packages with version management
node npm/scripts/prepare-packages.js

# Copy binaries to platform directories
cp extracted/ccline-darwin-x64 npm-publish/darwin-x64/ccline
cp extracted/ccline-darwin-arm64 npm-publish/darwin-arm64/ccline
cp extracted/ccline-linux-x64 npm-publish/linux-x64/ccline
cp extracted/ccline-linux-x64-musl npm-publish/linux-x64-musl/ccline
cp extracted/ccline-win32-x64.exe npm-publish/win32-x64/ccline.exe
cp extracted/ccline-88cc-darwin-x64 npm-publish/darwin-x64/ccline-88cc
cp extracted/ccline-88cc-darwin-arm64 npm-publish/darwin-arm64/ccline-88cc
cp extracted/ccline-88cc-linux-x64 npm-publish/linux-x64/ccline-88cc
cp extracted/ccline-88cc-linux-x64-musl npm-publish/linux-x64-musl/ccline-88cc
cp extracted/ccline-88cc-win32-x64.exe npm-publish/win32-x64/ccline-88cc.exe

# Set executable permissions for Unix binaries
chmod +x npm-publish/darwin-x64/ccline
chmod +x npm-publish/darwin-arm64/ccline
chmod +x npm-publish/linux-x64/ccline
chmod +x npm-publish/linux-x64-musl/ccline
chmod +x npm-publish/darwin-x64/ccline-88cc
chmod +x npm-publish/darwin-arm64/ccline-88cc
chmod +x npm-publish/linux-x64/ccline-88cc
chmod +x npm-publish/linux-x64-musl/ccline-88cc

# Verify packages
echo "Package structure:"
find npm-publish -name "package.json" -exec echo "=== {} ===" \; -exec head -5 {} \;
Expand All @@ -161,11 +161,11 @@ jobs:
run: |
# Publish platform packages first
for platform in darwin-x64 darwin-arm64 linux-x64 linux-x64-musl win32-x64; do
echo "📦 Publishing @cometix/ccline-$platform"
echo "📦 Publishing @byebyecode/ccline-88cc-$platform"
cd npm-publish/$platform
npm publish --access public
cd ../..
echo "✅ Published @cometix/ccline-$platform"
echo "✅ Published @byebyecode/ccline-88cc-$platform"
done

- name: Wait for NPM registry
Expand All @@ -178,9 +178,9 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd npm-publish/main
echo "📦 Publishing @cometix/ccline"
echo "📦 Publishing @byebyecode/ccline-88cc"
npm publish --access public
echo "✅ Published @cometix/ccline"
echo "✅ Published @byebyecode/ccline-88cc"
echo ""
echo "🎉 NPM packages published successfully!"
echo "Install with: npm install -g @cometix/ccline"
echo "Install with: npm install -g @byebyecode/ccline-88cc"
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading