diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d016876..6b76982 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,11 +49,15 @@ jobs: with: command: build args: --release --target x86_64-unknown-linux-gnu + - name: Prepare binary + run: | + mkdir -p dist + cp ./target/x86_64-unknown-linux-gnu/release/aicommit ./dist/aicommit-linux-x86_64 - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: aicommit-linux-x86_64 - path: ./target/x86_64-unknown-linux-gnu/release/aicommit + name: binaries + path: ./dist/aicommit-linux-x86_64 if-no-files-found: error - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -61,7 +65,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build-and-release.outputs.upload_url }} - asset_path: ./target/x86_64-unknown-linux-gnu/release/aicommit + asset_path: ./dist/aicommit-linux-x86_64 asset_name: aicommit-linux-x86_64 asset_content_type: application/octet-stream @@ -80,11 +84,15 @@ jobs: with: command: build args: --release --target x86_64-apple-darwin + - name: Prepare binary + run: | + mkdir -p dist + cp ./target/x86_64-apple-darwin/release/aicommit ./dist/aicommit-macos-x86_64 - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: aicommit-macos-x86_64 - path: ./target/x86_64-apple-darwin/release/aicommit + name: binaries + path: ./dist/aicommit-macos-x86_64 if-no-files-found: error - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -92,7 +100,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build-and-release.outputs.upload_url }} - asset_path: ./target/x86_64-apple-darwin/release/aicommit + asset_path: ./dist/aicommit-macos-x86_64 asset_name: aicommit-macos-x86_64 asset_content_type: application/octet-stream @@ -111,11 +119,15 @@ jobs: with: command: build args: --release --target aarch64-apple-darwin + - name: Prepare binary + run: | + mkdir -p dist + cp ./target/aarch64-apple-darwin/release/aicommit ./dist/aicommit-macos-aarch64 - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: aicommit-macos-aarch64 - path: ./target/aarch64-apple-darwin/release/aicommit + name: binaries + path: ./dist/aicommit-macos-aarch64 if-no-files-found: error - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -123,7 +135,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build-and-release.outputs.upload_url }} - asset_path: ./target/aarch64-apple-darwin/release/aicommit + asset_path: ./dist/aicommit-macos-aarch64 asset_name: aicommit-macos-aarch64 asset_content_type: application/octet-stream @@ -142,11 +154,15 @@ jobs: with: command: build args: --release --target x86_64-pc-windows-msvc + - name: Prepare binary + run: | + mkdir -p dist + cp ./target/x86_64-pc-windows-msvc/release/aicommit.exe ./dist/aicommit-windows-x86_64.exe - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: aicommit-windows-x86_64 - path: ./target/x86_64-pc-windows-msvc/release/aicommit.exe + name: binaries + path: ./dist/aicommit-windows-x86_64.exe if-no-files-found: error - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -154,7 +170,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build-and-release.outputs.upload_url }} - asset_path: ./target/x86_64-pc-windows-msvc/release/aicommit.exe + asset_path: ./dist/aicommit-windows-x86_64.exe asset_name: aicommit-windows-x86_64.exe asset_content_type: application/octet-stream @@ -173,11 +189,15 @@ jobs: with: command: build args: --release --target aarch64-pc-windows-msvc + - name: Prepare binary + run: | + mkdir -p dist + cp ./target/aarch64-pc-windows-msvc/release/aicommit.exe ./dist/aicommit-windows-aarch64.exe - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: aicommit-windows-aarch64 - path: ./target/aarch64-pc-windows-msvc/release/aicommit.exe + name: binaries + path: ./dist/aicommit-windows-aarch64.exe if-no-files-found: error - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -185,7 +205,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.build-and-release.outputs.upload_url }} - asset_path: ./target/aarch64-pc-windows-msvc/release/aicommit.exe + asset_path: ./dist/aicommit-windows-aarch64.exe asset_name: aicommit-windows-aarch64.exe asset_content_type: application/octet-stream @@ -207,88 +227,27 @@ jobs: args: --allow-dirty publish-npm: - needs: [build-and-release, build-linux-x86, build-macos-x86, build-macos-arm, build-windows-x86, build-windows-arm] + needs: [build-linux-x86, build-macos-x86, build-macos-arm, build-windows-x86, build-windows-arm] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - - - name: Create bin directory - run: mkdir -p bin - - - name: Download Linux x86_64 + - name: Download all artifacts uses: actions/download-artifact@v4 with: - name: aicommit-linux-x86_64 + name: binaries path: bin - - - name: Download macOS x86_64 - uses: actions/download-artifact@v4 - with: - name: aicommit-macos-x86_64 - path: bin - - - name: Download macOS ARM64 - uses: actions/download-artifact@v4 - with: - name: aicommit-macos-aarch64 - path: bin - - - name: Download Windows x86_64 - uses: actions/download-artifact@v4 - with: - name: aicommit-windows-x86_64 - path: bin - - - name: Download Windows ARM64 - uses: actions/download-artifact@v4 - with: - name: aicommit-windows-aarch64 - path: bin - - - name: Move binaries to correct location + - name: Show binary files run: | - mkdir -p bin - echo "Current directory structure:" - find bin -type f -ls - - # Перемещаем файлы с правильными именами - for file in bin/*/aicommit*; do - dir=$(dirname "$file") - platform=$(basename "$dir") - echo "Processing $file from $platform" - - case "$platform" in - "aicommit-linux-x86_64") - mv "$file" "bin/aicommit-linux-x86_64" - ;; - "aicommit-macos-x86_64") - mv "$file" "bin/aicommit-macos-x86_64" - ;; - "aicommit-macos-aarch64") - mv "$file" "bin/aicommit-macos-aarch64" - ;; - "aicommit-windows-x86_64") - mv "$file" "bin/aicommit-windows-x86_64.exe" - ;; - "aicommit-windows-aarch64") - mv "$file" "bin/aicommit-windows-aarch64.exe" - ;; - esac - done - - # Удаляем пустые директории - rm -rf bin/*/ - - echo "Final bin directory contents:" + echo "Binary files in bin/:" ls -la bin/ file bin/* || true chmod +x bin/aicommit-* - + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' - name: Publish to npm - run: npm publish --access=public + run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 9bf1746..6a5775d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "aicommit" -version = "0.1.84" +version = "0.1.87" dependencies = [ "clap", "console", diff --git a/Cargo.toml b/Cargo.toml index 1fe5ff1..d45928b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aicommit" -version = "0.1.84" +version = "0.1.87" edition = "2021" authors = ["Eugen Soloviov "] description = "A CLI tool that generates concise and descriptive git commit messages using LLMs" diff --git a/package.json b/package.json index 718e761..96330cf 100644 --- a/package.json +++ b/package.json @@ -36,5 +36,5 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "version": "0.1.84" + "version": "0.1.87" } \ No newline at end of file diff --git a/version b/version index b4e382e..cdc07a0 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.1.84 \ No newline at end of file +0.1.87 \ No newline at end of file