chore: release v1.1.1 #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build for ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| name: ccline-linux-x64.tar.gz | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| name: ccline-linux-x64-static.tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| name: ccline-linux-arm64.tar.gz | |
| use_zigbuild: true | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| name: ccline-linux-arm64-static.tar.gz | |
| use_zigbuild: true | |
| - target: x86_64-pc-windows-gnu | |
| os: ubuntu-latest | |
| name: ccline-windows-x64.zip | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| name: ccline-macos-x64.tar.gz | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: ccline-macos-arm64.tar.gz | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'x86_64-pc-windows-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y mingw-w64 | |
| - name: Setup Zig | |
| if: matrix.use_zigbuild | |
| uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.13.0 | |
| - name: Install cargo-zigbuild | |
| if: matrix.use_zigbuild | |
| run: cargo install cargo-zigbuild | |
| - 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 | |
| if: ${{ !matrix.use_zigbuild }} | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build binary with zigbuild | |
| if: matrix.use_zigbuild | |
| run: cargo zigbuild --release --target ${{ matrix.target }} | |
| - name: Package Linux/macOS | |
| if: matrix.os != 'windows-latest' && matrix.target != 'x86_64-pc-windows-gnu' | |
| run: | | |
| mkdir -p dist | |
| cp target/${{ matrix.target }}/release/ccometixline dist/ccline | |
| cd dist | |
| tar czf ../${{ matrix.name }} ccline | |
| - 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 | |
| cd dist | |
| zip ../${{ matrix.name }} ccline.exe | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: ${{ matrix.name }} | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Generate Release Notes | |
| uses: orhun/git-cliff-action@v4 | |
| id: git-cliff | |
| with: | |
| config: cliff.toml | |
| args: --latest --strip header | |
| env: | |
| OUTPUT: RELEASE_NOTES.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/*/* | |
| body_path: RELEASE_NOTES.md | |
| draft: false | |
| prerelease: false | |
| - name: Setup Node.js for NPM | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Extract binaries from archives | |
| run: | | |
| 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 | |
| # macOS ARM64 | |
| tar -xzf artifacts/ccline-macos-arm64.tar.gz/ccline-macos-arm64.tar.gz -C extracted | |
| mv extracted/ccline extracted/ccline-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 | |
| # 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 | |
| # Linux ARM64 | |
| tar -xzf artifacts/ccline-linux-arm64.tar.gz/ccline-linux-arm64.tar.gz -C extracted | |
| mv extracted/ccline extracted/ccline-linux-arm64 | |
| # Linux ARM64 musl (static) | |
| tar -xzf artifacts/ccline-linux-arm64-static.tar.gz/ccline-linux-arm64-static.tar.gz -C extracted | |
| mv extracted/ccline extracted/ccline-linux-arm64-musl | |
| # Windows | |
| unzip artifacts/ccline-windows-x64.zip/ccline-windows-x64.zip -d extracted | |
| mv extracted/ccline.exe extracted/ccline-win32-x64.exe | |
| # List extracted files | |
| ls -la extracted/ | |
| - name: Prepare NPM packages | |
| 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-linux-arm64 npm-publish/linux-arm64/ccline | |
| cp extracted/ccline-linux-arm64-musl npm-publish/linux-arm64-musl/ccline | |
| cp extracted/ccline-win32-x64.exe npm-publish/win32-x64/ccline.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/linux-arm64/ccline | |
| chmod +x npm-publish/linux-arm64-musl/ccline | |
| # Verify packages | |
| echo "Package structure:" | |
| find npm-publish -name "package.json" -exec echo "=== {} ===" \; -exec head -5 {} \; | |
| - name: Publish platform packages to NPM | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| # Publish platform packages first | |
| for platform in darwin-x64 darwin-arm64 linux-x64 linux-x64-musl linux-arm64 linux-arm64-musl win32-x64; do | |
| echo "📦 Publishing @cometix/ccline-$platform" | |
| cd npm-publish/$platform | |
| npm publish --access public | |
| cd ../.. | |
| echo "✅ Published @cometix/ccline-$platform" | |
| done | |
| - name: Wait for NPM registry | |
| run: | | |
| echo "⏳ Waiting for platform packages to be available on NPM..." | |
| sleep 30 | |
| - name: Publish main package to NPM | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| cd npm-publish/main | |
| echo "📦 Publishing @cometix/ccline" | |
| npm publish --access public | |
| echo "✅ Published @cometix/ccline" | |
| echo "" | |
| echo "🎉 NPM packages published successfully!" | |
| echo "Install with: npm install -g @cometix/ccline" |