Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
suenot committed Jan 31, 2025
2 parents 83b82ed + 116b3cf commit 7d93d5a
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 91 deletions.
133 changes: 46 additions & 87 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,23 @@ 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
env:
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

Expand All @@ -80,19 +84,23 @@ 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
env:
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

Expand All @@ -111,19 +119,23 @@ 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
env:
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

Expand All @@ -142,19 +154,23 @@ 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
env:
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

Expand All @@ -173,19 +189,23 @@ 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
env:
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

Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aicommit"
version = "0.1.84"
version = "0.1.87"
edition = "2021"
authors = ["Eugen Soloviov <[email protected]>"]
description = "A CLI tool that generates concise and descriptive git commit messages using LLMs"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.84"
"version": "0.1.87"
}
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.84
0.1.87

0 comments on commit 7d93d5a

Please sign in to comment.