From 2746bfbc474c7d0c69f305990f2b63482b7b1257 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Tue, 27 May 2025 23:41:43 +0200 Subject: [PATCH 01/48] Update cd.yml --- .github/workflows/cd.yml | 108 ++++++++++++--------------------------- 1 file changed, 32 insertions(+), 76 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9378a44..50f3f6a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: CD +name: Continuous Delivery on: push: @@ -18,13 +18,11 @@ permissions: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }} - ACTIONS_RUNTIME_TOKEN: dummy CARGO_TERM_COLOR: always jobs: artifact: runs-on: ${{ matrix.os }} - continue-on-error: false strategy: matrix: include: @@ -39,110 +37,68 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Rust - uses: dtolnay/rust-toolchain@nightly + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Add x86_64-unknown-linux-musl target - if: matrix.target == 'x86_64-unknown-linux-musl' - run: | - rustup target add x86_64-unknown-linux-musl - sudo apt-get update && sudo apt-get install -y musl-tools - - - name: Install Dependencies for musl Target + - name: Setup Dependencies for Linux/Musl if: matrix.target == 'x86_64-unknown-linux-musl' run: | sudo apt-get update sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev - # Set up environment for musl compilation - echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV - - name: Install Dependencies for Linux Target + - name: Setup Dependencies for Linux GNU if: matrix.target == 'x86_64-unknown-linux-gnu' run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Build for target - run: | - cargo build \ - -Z unstable-options \ - --profile release-with-debug \ - --artifact-dir bin \ - --target ${{ matrix.target }} - - - name: Upload and compress artifacts - uses: actions/upload-artifact@v4 + - name: Build + run: cargo build --release --target ${{ matrix.target }} + + - uses: actions/upload-artifact@v4 with: name: git-ai-${{ matrix.target }} if-no-files-found: error - path: bin/git-* + path: target/${{ matrix.target }}/release/git-ai release: runs-on: ubuntu-latest needs: artifact steps: - uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} - - name: Setup Rust - uses: dtolnay/rust-toolchain@nightly - - - name: Configure git user name - run: git config user.name ${{ github.actor }} - - - name: Configure git email - run: git config user.email ${{ github.actor }}@users.noreply.github.com - - - name: Install cargo-bump - run: cargo install cargo-bump - - - name: Bump version - run: cargo bump patch --git-tag - - - name: Commit Version Bump - run: git commit -a --amend --no-edit - - - name: New version - id: app - run: echo "version=$(git describe --tags --abbrev=0 HEAD)" >> $GITHUB_OUTPUT - - - name: Delete old tag - run: git tag -d ${{ steps.app.outputs.version }} - - - name: Create new tag - run: git tag v${{ steps.app.outputs.version }} - - - name: Publish to crates.io - if: github.ref == 'refs/heads/main' - run: cargo publish --allow-dirty + - uses: dtolnay/rust-toolchain@stable - - name: Test publish to crates.io (dry run) - if: github.ref != 'refs/heads/main' - run: cargo publish --dry-run --allow-dirty + - name: Install cargo-release + run: cargo install cargo-release - - name: Push to origin - if: github.ref == 'refs/heads/main' - run: git push origin HEAD --tags + - name: Configure git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" - - name: Test push to origin (dry run) - if: github.ref != 'refs/heads/main' - run: git push origin HEAD --tags --dry-run + - name: Release to crates.io + run: cargo release patch --no-confirm - - name: Download all artifacts - run: gh run download ${{ github.run_id }} + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts - - name: Zip each downloaded directory + - name: Package artifacts run: | - for dir in $(ls -d git-ai-*); do - tar -czf ${dir}.tar.gz ${dir} + mkdir release + for dir in artifacts/git-ai-*; do + target=$(basename $dir) + tar -czf release/${target}.tar.gz -C $dir git-ai done - - name: Uploads compressed artifacts - if: github.ref == 'refs/heads/main' + - name: Upload Release uses: softprops/action-gh-release@v2 with: - tag_name: v${{ steps.app.outputs.version }} - fail_on_unmatched_files: true - files: git-ai-*.tar.gz + files: release/*.tar.gz + fail_on_unmatched_files: true \ No newline at end of file From fb47ea9b1166cb5bfcde52ff0bf0f5374d8c81d3 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:43:11 +0200 Subject: [PATCH 02/48] =?UTF-8?q?feat:=20Update=20Configuration=20and=20Co?= =?UTF-8?q?re=20Components=20(#35)=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 7 +++++-- Cargo.lock | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 50f3f6a..272bc07 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -73,8 +73,11 @@ jobs: - uses: dtolnay/rust-toolchain@stable + - name: Install cargo-binstall + run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + - name: Install cargo-release - run: cargo install cargo-release + run: cargo binstall -y cargo-release - name: Configure git run: | @@ -101,4 +104,4 @@ jobs: uses: softprops/action-gh-release@v2 with: files: release/*.tar.gz - fail_on_unmatched_files: true \ No newline at end of file + fail_on_unmatched_files: true diff --git a/Cargo.lock b/Cargo.lock index 3c186a9..c57c699 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-ai" -version = "1.0.7" +version = "1.0.8" dependencies = [ "anyhow", "async-openai", From 6d71b68b31b4b3c3191d4b7bdccde6ece005850b Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:44:05 +0200 Subject: [PATCH 03/48] chore: Release git-ai version 1.0.9 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c57c699..aaf9942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-ai" -version = "1.0.8" +version = "1.0.9" dependencies = [ "anyhow", "async-openai", diff --git a/Cargo.toml b/Cargo.toml index 08a09b9..9a147fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-ai" -version = "1.0.8" +version = "1.0.9" edition = "2021" description = "Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages." license = "MIT" From 819f874ddc6173f9dcc250d4b095bd5aef5bc125 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:50:42 +0200 Subject: [PATCH 04/48] =?UTF-8?q?OK=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 79 +++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 272bc07..229bf51 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Continuous Delivery +name: CD on: push: @@ -18,11 +18,13 @@ permissions: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }} + ACTIONS_RUNTIME_TOKEN: dummy CARGO_TERM_COLOR: always jobs: artifact: runs-on: ${{ matrix.os }} + continue-on-error: false strategy: matrix: include: @@ -37,41 +39,60 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - name: Setup Rust + uses: dtolnay/rust-toolchain@nightly with: targets: ${{ matrix.target }} - - name: Setup Dependencies for Linux/Musl + - name: Add x86_64-unknown-linux-musl target + if: matrix.target == 'x86_64-unknown-linux-musl' + run: | + rustup target add x86_64-unknown-linux-musl + sudo apt-get update && sudo apt-get install -y musl-tools + + - name: Install Dependencies for musl Target if: matrix.target == 'x86_64-unknown-linux-musl' run: | sudo apt-get update sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev + # Set up environment for musl compilation + echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV - - name: Setup Dependencies for Linux GNU + - name: Install Dependencies for Linux Target if: matrix.target == 'x86_64-unknown-linux-gnu' run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Build - run: cargo build --release --target ${{ matrix.target }} - - - uses: actions/upload-artifact@v4 + - name: Build for target + run: | + cargo build \ + -Z unstable-options \ + --profile release-with-debug \ + --artifact-dir bin \ + --target ${{ matrix.target }} + + - name: Upload and compress artifacts + uses: actions/upload-artifact@v4 with: name: git-ai-${{ matrix.target }} if-no-files-found: error - path: target/${{ matrix.target }}/release/git-ai + path: bin/git-* release: runs-on: ubuntu-latest needs: artifact steps: - uses: actions/checkout@v4 - with: - token: ${{ secrets.GH_TOKEN }} - - uses: dtolnay/rust-toolchain@stable + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Configure git email + run: | + git config user.name ${{ github.actor }} + git config user.email ${{ github.actor }}@users.noreply.github.com - name: Install cargo-binstall run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash @@ -79,29 +100,29 @@ jobs: - name: Install cargo-release run: cargo binstall -y cargo-release - - name: Configure git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - name: Release to crates.io - run: cargo release patch --no-confirm + if: github.ref == 'refs/heads/main' + run: cargo release patch --no-confirm --execute - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - path: artifacts + - name: Test release to crates.io (dry run) + if: github.ref != 'refs/heads/main' + run: cargo release patch --no-confirm --no-push + + - name: Download all artifacts + if: github.ref == 'refs/heads/main' + run: gh run download ${{ github.run_id }} - - name: Package artifacts + - name: Zip each downloaded directory + if: github.ref == 'refs/heads/main' run: | - mkdir release - for dir in artifacts/git-ai-*; do - target=$(basename $dir) - tar -czf release/${target}.tar.gz -C $dir git-ai + for dir in $(ls -d git-ai-*); do + tar -czf ${dir}.tar.gz ${dir} done - - name: Upload Release + - name: Uploads compressed artifacts + if: github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: - files: release/*.tar.gz + tag_name: v${{ steps.app.outputs.version }} fail_on_unmatched_files: true + files: git-ai-*.tar.gz From 092dd7a44fafe928fa9a5c27230176f1dce8cdad Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:51:03 +0200 Subject: [PATCH 05/48] =?UTF-8?q?Add=20'colored'=20dependency=20and=20util?= =?UTF-8?q?ize=20for=20improved=20UI=20in=20examples.rs=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 229bf51..334d096 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,6 +5,7 @@ on: branches: - main workflow_dispatch: + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From c7efbdb39c42c999ea686bcba664ab924652c2f5 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:51:33 +0200 Subject: [PATCH 06/48] =?UTF-8?q?Fix=20early=20exit=20issue=20in=20simulat?= =?UTF-8?q?e.sh=20error=20handling=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 334d096..ca0c6fd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,12 +29,12 @@ jobs: strategy: matrix: include: - - os: macos-latest - target: x86_64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - os: macos-latest - target: aarch64-apple-darwin + # - os: macos-latest + # target: x86_64-apple-darwin + # - os: ubuntu-latest + # target: x86_64-unknown-linux-gnu + # - os: macos-latest + # target: aarch64-apple-darwin - os: ubuntu-latest target: x86_64-unknown-linux-musl steps: From 466221d838c08f96f8e4d908deeaa9e614c790ba Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:53:03 +0200 Subject: [PATCH 07/48] =?UTF-8?q?Update=20hook.rs=20for=20improved=20bin?= =?UTF-8?q?=20functionality=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ca0c6fd..8ef6be6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -83,7 +83,7 @@ jobs: release: runs-on: ubuntu-latest - needs: artifact + # needs: artifact steps: - uses: actions/checkout@v4 From a49f220d1aa9c6c525ee991404ef43b526004cc2 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:53:21 +0200 Subject: [PATCH 08/48] =?UTF-8?q?Add=20toolchain=20action=20to=20Rust=20wo?= =?UTF-8?q?rkflow=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8ef6be6..4e5c940 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -9,7 +9,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false + cancel-in-progress: true permissions: contents: write From 6b1985d171865ff209d71a1e259bd16a8b4f1fcc Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 02:56:27 +0200 Subject: [PATCH 09/48] =?UTF-8?q?The=20provided=20diff=20is=20incomplete?= =?UTF-8?q?=20and=20does=20not=20contain=20any=20change=20information.=20T?= =?UTF-8?q?o=20create=20a=20git=20commit=20message,=20I=20would=20need=20t?= =?UTF-8?q?he=20actual=20content=20changes=20in=20the=20diff.=20Please=20p?= =?UTF-8?q?rovide=20the=20full=20diff=20with=20the=20changes=20between=20t?= =?UTF-8?q?he=20two=20versions=20of=20the=20file.=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4e5c940..a91012d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -96,7 +96,9 @@ jobs: git config user.email ${{ github.actor }}@users.noreply.github.com - name: Install cargo-binstall - run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + uses: cargo-bins/cargo-binstall@main + with: + toolchain: stable - name: Install cargo-release run: cargo binstall -y cargo-release @@ -105,9 +107,9 @@ jobs: if: github.ref == 'refs/heads/main' run: cargo release patch --no-confirm --execute - - name: Test release to crates.io (dry run) - if: github.ref != 'refs/heads/main' - run: cargo release patch --no-confirm --no-push + # - name: Test release to crates.io (dry run) + # if: github.ref != 'refs/heads/main' + # run: cargo release patch --no-confirm --no-push - name: Download all artifacts if: github.ref == 'refs/heads/main' From 15303a6617e5056ba432838b7505d6f8f2309ec2 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:01:10 +0200 Subject: [PATCH 10/48] =?UTF-8?q?Update=20git-ai=20to=20version=200.1.14?= =?UTF-8?q?=20in=20Cargo.lock=20and=20Cargo.toml=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a91012d..088fa4f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -40,6 +40,17 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Cache cargo registry + build artefacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust uses: dtolnay/rust-toolchain@nightly with: @@ -87,6 +98,16 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Setup Rust uses: dtolnay/rust-toolchain@stable @@ -104,26 +125,22 @@ jobs: run: cargo binstall -y cargo-release - name: Release to crates.io - if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute - - # - name: Test release to crates.io (dry run) - # if: github.ref != 'refs/heads/main' - # run: cargo release patch --no-confirm --no-push + # if: github.ref == 'refs/heads/main' + run: cargo release patch --no-confirm --execute - name: Download all artifacts - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' run: gh run download ${{ github.run_id }} - name: Zip each downloaded directory - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' run: | for dir in $(ls -d git-ai-*); do tar -czf ${dir}.tar.gz ${dir} done - name: Uploads compressed artifacts - if: github.ref == 'refs/heads/main' + # if: github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: tag_name: v${{ steps.app.outputs.version }} From f9d97417b38d5c6c17ebbcbb6ac62f2ea64f77f5 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:01:40 +0200 Subject: [PATCH 11/48] =?UTF-8?q?Update=20hook.rs=20for=20improved=20bin?= =?UTF-8?q?=20functionality=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 088fa4f..8a5d39f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -52,7 +52,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Setup Rust - uses: dtolnay/rust-toolchain@nightly + uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} From bc08b83390d7e02777d3857d780940c62e93634d Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:04:02 +0200 Subject: [PATCH 12/48] =?UTF-8?q?Remove=20debug=20flag=20from=20cargo=20in?= =?UTF-8?q?stall=20command=20in=20Justfile=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8a5d39f..2e5346c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -44,12 +44,13 @@ jobs: uses: actions/cache@v4 with: path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ + ~/.cargo/registry + ~/.cargo/git + target key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.target }}-cargo- + ${{ runner.os }}-cargo- - name: Setup Rust uses: dtolnay/rust-toolchain@stable @@ -98,15 +99,16 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/cache@v4 + - name: Cache cargo registry + build artefacts + uses: actions/cache@v4 with: path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ + ~/.cargo/registry + ~/.cargo/git + target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - name: Setup Rust uses: dtolnay/rust-toolchain@stable From 83d65eca6464700fc18bbc3e1e8e5b9af1bd3f01 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:05:21 +0200 Subject: [PATCH 13/48] =?UTF-8?q?Refactor=20duplicated=20repo=20creation?= =?UTF-8?q?=20logic=20into=20into=5Frepo=20method=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2e5346c..1f4f837 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,7 @@ jobs: - name: Release to crates.io # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute + run: cargo release patch --no-confirm --execute --allow-branch ${{ github.ref }} - name: Download all artifacts # if: github.ref == 'refs/heads/main' From f8d39c46ed4c5c6d11decdd411eb8b1f46a371a1 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:08:44 +0200 Subject: [PATCH 14/48] =?UTF-8?q?Normalize=20table=20markdown=20format=20i?= =?UTF-8?q?n=20README.md=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1f4f837..6470e19 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,7 @@ jobs: - name: Release to crates.io # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute --allow-branch ${{ github.ref }} + run: cargo release patch --no-confirm --execute --allow-branch ${{ github.ref }} --tag-prefix v - name: Download all artifacts # if: github.ref == 'refs/heads/main' From fa9c2e2dc233df1ae1c21cd3233eeafdfb49825b Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:09:18 +0200 Subject: [PATCH 15/48] =?UTF-8?q?Specify=20target=20in=20cargo=20publish?= =?UTF-8?q?=20command=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6470e19..91c73a2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,7 @@ jobs: - name: Release to crates.io # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute --allow-branch ${{ github.ref }} --tag-prefix v + run: cargo release patch --no-confirm --execute --allow-branch HEAD --tag-prefix v - name: Download all artifacts # if: github.ref == 'refs/heads/main' From 464c0849aedab31c07db04260b6b80b5e961bb82 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:11:53 +0200 Subject: [PATCH 16/48] =?UTF-8?q?Update=20Cargo.toml=20with=20new=20target?= =?UTF-8?q?s;=20enhance=20CI=20workflow=20steps=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 91c73a2..911e0d7 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -145,6 +145,6 @@ jobs: # if: github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: - tag_name: v${{ steps.app.outputs.version }} + # tag_name: v${{ steps.app.outputs.version }} fail_on_unmatched_files: true files: git-ai-*.tar.gz From 0d9f648d8f7f7c29ac3a0fd541fd479e0bb9f69e Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:13:03 +0200 Subject: [PATCH 17/48] =?UTF-8?q?The=20provided=20diff=20is=20incomplete?= =?UTF-8?q?=20and=20does=20not=20contain=20any=20change=20information.=20T?= =?UTF-8?q?o=20create=20a=20git=20commit=20message,=20I=20would=20need=20t?= =?UTF-8?q?he=20actual=20content=20changes=20in=20the=20diff.=20Please=20p?= =?UTF-8?q?rovide=20the=20full=20diff=20with=20the=20changes=20between=20t?= =?UTF-8?q?he=20two=20versions=20of=20the=20file.=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 911e0d7..d84d2dd 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,7 @@ jobs: - name: Release to crates.io # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute --allow-branch HEAD --tag-prefix v + run: cargo release patch --no-confirm --execute --allow-branch oleander-patch-1 - name: Download all artifacts # if: github.ref == 'refs/heads/main' From 21e2d62fc844b71f4a6ac02a7761a6af83687b1b Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:18:03 +0200 Subject: [PATCH 18/48] =?UTF-8?q?Refactor=20error=20handling=20in=20networ?= =?UTF-8?q?k=20and=20git=20operations=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaf9942..9b58be6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-ai" -version = "1.0.9" +version = "1.0.11" dependencies = [ "anyhow", "async-openai", diff --git a/Cargo.toml b/Cargo.toml index 9a147fa..afc134b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-ai" -version = "1.0.9" +version = "1.0.11" edition = "2021" description = "Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages." license = "MIT" From bfeb006b40f029fa90fa0ee1b376ac7f38849a06 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:20:09 +0200 Subject: [PATCH 19/48] =?UTF-8?q?Remove=20commented-out=20build=20targets?= =?UTF-8?q?=20in=20cd.yml=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d84d2dd..d160b48 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -95,7 +95,7 @@ jobs: release: runs-on: ubuntu-latest - # needs: artifact + needs: artifact steps: - uses: actions/checkout@v4 From 0813ff54a182987cb82895a67253ad843e02282f Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:20:54 +0200 Subject: [PATCH 20/48] =?UTF-8?q?Update=20code=20and=20README=20for=20bett?= =?UTF-8?q?er=20clarity=20and=20accuracy=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d160b48..9c79d48 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,7 @@ jobs: - name: Release to crates.io # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute --allow-branch oleander-patch-1 + run: cargo release patch --no-confirm --execute --allow-branch HEAD - name: Download all artifacts # if: github.ref == 'refs/heads/main' From 4664654f2d4a7bcba7c69f5e9aa2e3a9bb482791 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:34:46 +0200 Subject: [PATCH 21/48] =?UTF-8?q?Update=20Dockerfile=20to=20use=20Rust=20v?= =?UTF-8?q?ersion=201.76.0=20for=20improved=20compatibility=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 41 +++++++++++++++++++++++++---------- .github/workflows/release.yml | 0 2 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9c79d48..3388972 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -2,6 +2,8 @@ name: CD on: push: + tags: + - 'v*' branches: - main workflow_dispatch: @@ -25,6 +27,7 @@ env: jobs: artifact: runs-on: ${{ matrix.os }} + if: github.event_name == 'push' continue-on-error: false strategy: matrix: @@ -93,12 +96,37 @@ jobs: if-no-files-found: error path: bin/git-* - release: + build: runs-on: ubuntu-latest needs: artifact steps: - uses: actions/checkout@v4 + - name: Cache cargo registry + build artefacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install cargo-release + run: cargo binstall -y cargo-release + + - name: Release to crates.io + run: cargo release patch --no-confirm --execute --allow-branch HEAD + release: + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 + - name: Cache cargo registry + build artefacts uses: actions/cache@v4 with: @@ -123,28 +151,17 @@ jobs: with: toolchain: stable - - name: Install cargo-release - run: cargo binstall -y cargo-release - - - name: Release to crates.io - # if: github.ref == 'refs/heads/main' - run: cargo release patch --no-confirm --execute --allow-branch HEAD - - name: Download all artifacts - # if: github.ref == 'refs/heads/main' run: gh run download ${{ github.run_id }} - name: Zip each downloaded directory - # if: github.ref == 'refs/heads/main' run: | for dir in $(ls -d git-ai-*); do tar -czf ${dir}.tar.gz ${dir} done - name: Uploads compressed artifacts - # if: github.ref == 'refs/heads/main' uses: softprops/action-gh-release@v2 with: - # tag_name: v${{ steps.app.outputs.version }} fail_on_unmatched_files: true files: git-ai-*.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e69de29 From 720531eb730480378e97d166802cf4e1ec2e0846 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:35:29 +0200 Subject: [PATCH 22/48] =?UTF-8?q?Update=20workflow=20and=20README=20to=20r?= =?UTF-8?q?eflect=20logic=20move=20to=20config.rs=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3388972..6a8edc2 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -27,7 +27,7 @@ env: jobs: artifact: runs-on: ${{ matrix.os }} - if: github.event_name == 'push' + if: github.event_name == 'pull_request' continue-on-error: false strategy: matrix: From 547cefe0777fee2fce30b8112a170e05d1cd4a69 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:40:07 +0200 Subject: [PATCH 23/48] =?UTF-8?q?Remove=20redundant=20progress=20bar=20cal?= =?UTF-8?q?lbacks=20in=20hook.rs=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6a8edc2..1384ed6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -98,7 +98,6 @@ jobs: build: runs-on: ubuntu-latest - needs: artifact steps: - uses: actions/checkout@v4 From 849bb4adf55d8b3d60df81bec83aef05bc8e59a8 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:43:43 +0200 Subject: [PATCH 24/48] =?UTF-8?q?Fix=20duplicate=20sections=20in=20github?= =?UTF-8?q?=20workflow=20YAML=20file=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 170 ++++++++++++++++++++++----------------- 1 file changed, 98 insertions(+), 72 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1384ed6..8201175 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,13 +1,10 @@ name: CD on: + pull_request: # CI + (optional) publish push: - tags: - - 'v*' - branches: - - main - workflow_dispatch: - pull_request: + tags: ['v*'] # create GitHub Release + workflow_dispatch: # manual runs if you want concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,73 +12,64 @@ concurrency: permissions: contents: write - actions: write + actions: write packages: write env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} ACTIONS_RUNTIME_TOKEN: dummy - CARGO_TERM_COLOR: always + CARGO_TERM_COLOR: always +# ───────────────────────────────────────────────────────────── +# 1. CI build for every PR (all requested targets) +# ───────────────────────────────────────────────────────────── jobs: artifact: - runs-on: ${{ matrix.os }} if: github.event_name == 'pull_request' - continue-on-error: false + runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: include: - # - os: macos-latest - # target: x86_64-apple-darwin - # - os: ubuntu-latest - # target: x86_64-unknown-linux-gnu - # - os: macos-latest - # target: aarch64-apple-darwin + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin - os: ubuntu-latest - target: x86_64-unknown-linux-musl + target: x86_64-unknown-linux-gnu + steps: - uses: actions/checkout@v4 - - name: Cache cargo registry + build artefacts + - name: Cache cargo + target uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ + hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.target }}-cargo- ${{ runner.os }}-cargo- - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - name: Add x86_64-unknown-linux-musl target - if: matrix.target == 'x86_64-unknown-linux-musl' - run: | - rustup target add x86_64-unknown-linux-musl - sudo apt-get update && sudo apt-get install -y musl-tools - - - name: Install Dependencies for musl Target - if: matrix.target == 'x86_64-unknown-linux-musl' - run: | - sudo apt-get update - sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev - # Set up environment for musl compilation - echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV - echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV - - - name: Install Dependencies for Linux Target - if: matrix.target == 'x86_64-unknown-linux-gnu' + - name: Extra Linux deps + if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Build for target + - name: Add Apple target (cross-compile to ARM) + if: startsWith(matrix.target, 'aarch64-apple') + run: rustup target add aarch64-apple-darwin + + - name: Build run: | cargo build \ -Z unstable-options \ @@ -89,78 +77,116 @@ jobs: --artifact-dir bin \ --target ${{ matrix.target }} - - name: Upload and compress artifacts - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: name: git-ai-${{ matrix.target }} if-no-files-found: error path: bin/git-* - build: +# ───────────────────────────────────────────────────────────── +# 2. Publish crate **from PR** (same-repo branches only) +# ───────────────────────────────────────────────────────────── + publish-crate: + needs: artifact + if: > + github.event_name == 'pull_request' && + github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Cache cargo registry + build artefacts + - name: Cache cargo uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + key: ${{ runner.os }}-cargo-${{ + hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable - name: Install cargo-release run: cargo binstall -y cargo-release - - name: Release to crates.io - run: cargo release patch --no-confirm --execute --allow-branch HEAD + - name: Publish & tag + run: cargo release patch --no-confirm --execute + +# ───────────────────────────────────────────────────────────── +# 3. GitHub Release (runs on the tag push) +# ───────────────────────────────────────────────────────────── release: - runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + steps: - uses: actions/checkout@v4 - - name: Cache cargo registry + build artefacts + - name: Cache cargo + target uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ + hashFiles('**/Cargo.lock') }} restore-keys: | + ${{ runner.os }}-${{ matrix.target }}-cargo- ${{ runner.os }}-cargo- - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} - - name: Configure git email + - name: Extra Linux deps + if: matrix.os == 'ubuntu-latest' run: | - git config user.name ${{ github.actor }} - git config user.email ${{ github.actor }}@users.noreply.github.com - - - name: Install cargo-binstall - uses: cargo-bins/cargo-binstall@main - with: - toolchain: stable + sudo apt-get update + sudo apt-get install -y pkg-config libssl-dev - - name: Download all artifacts - run: gh run download ${{ github.run_id }} + - name: Add Apple target (cross-compile to ARM) + if: startsWith(matrix.target, 'aarch64-apple') + run: rustup target add aarch64-apple-darwin - - name: Zip each downloaded directory + - name: Build release binary run: | - for dir in $(ls -d git-ai-*); do - tar -czf ${dir}.tar.gz ${dir} - done + cargo build --release --locked --target ${{ matrix.target }} + mkdir dist + cp target/${{ matrix.target }}/release/git-ai dist/ + tar -C dist -czf \ + git-ai-${{ matrix.target }}.tar.gz git-ai + + - uses: actions/upload-artifact@v4 + with: + name: bin-${{ matrix.target }} + path: git-ai-${{ matrix.target }}.tar.gz + if-no-files-found: error + + publish-release: + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - name: Download all target artifacts + uses: actions/download-artifact@v4 + with: + path: dist - - name: Uploads compressed artifacts + - name: Create / update GitHub Release uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true - files: git-ai-*.tar.gz + files: dist/**/*.tar.gz From 0fd323b66bb8c285585baa405bb64aa242f3b31a Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:45:40 +0200 Subject: [PATCH 25/48] =?UTF-8?q?Refactor=20release=20script=20from=20shel?= =?UTF-8?q?l=20to=20fish=20script=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8201175..d414e4b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -55,7 +55,7 @@ jobs: ${{ runner.os }}-${{ matrix.target }}-cargo- ${{ runner.os }}-cargo- - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@nightly with: targets: ${{ matrix.target }} From 33ff6fdcdeba4ec80e9c66cceb2423d4a0cc9466 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:53:20 +0200 Subject: [PATCH 26/48] =?UTF-8?q?Enable=20Cargo=20test,=20publish,=20and?= =?UTF-8?q?=20build=20in=20Github=20workflows=20for=20CD=20and=20CI=20?= =?UTF-8?q?=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 345 +++++++++++++++++++++++++++++++-------- 1 file changed, 277 insertions(+), 68 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d414e4b..4ae9af3 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,10 +1,10 @@ name: CD on: - pull_request: # CI + (optional) publish + pull_request: # CI + (optional) publish push: - tags: ['v*'] # create GitHub Release - workflow_dispatch: # manual runs if you want + tags: ['v*'] # create GitHub Release + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -21,24 +21,15 @@ env: ACTIONS_RUNTIME_TOKEN: dummy CARGO_TERM_COLOR: always +jobs: # ───────────────────────────────────────────────────────────── -# 1. CI build for every PR (all requested targets) +# 1. CI build (PR only) – single target # ───────────────────────────────────────────────────────────── -jobs: artifact: if: github.event_name == 'pull_request' - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - target: x86_64-apple-darwin - - os: macos-latest - target: aarch64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - + runs-on: ubuntu-latest + env: + TARGET: x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v4 @@ -49,39 +40,34 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-${{ matrix.target }}-cargo- + ${{ runner.os }}-${{ env.TARGET }}-cargo- ${{ runner.os }}-cargo- - uses: dtolnay/rust-toolchain@nightly with: - targets: ${{ matrix.target }} + targets: ${{ env.TARGET }} - - name: Extra Linux deps - if: matrix.os == 'ubuntu-latest' + - name: Install Linux build deps run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Add Apple target (cross-compile to ARM) - if: startsWith(matrix.target, 'aarch64-apple') - run: rustup target add aarch64-apple-darwin - - name: Build run: | cargo build \ -Z unstable-options \ --profile release-with-debug \ --artifact-dir bin \ - --target ${{ matrix.target }} + --target ${{ env.TARGET }} - uses: actions/upload-artifact@v4 with: - name: git-ai-${{ matrix.target }} - if-no-files-found: error + name: git-ai-${{ env.TARGET }} path: bin/git-* + if-no-files-found: error # ───────────────────────────────────────────────────────────── # 2. Publish crate **from PR** (same-repo branches only) @@ -108,29 +94,40 @@ jobs: - uses: dtolnay/rust-toolchain@stable + - name: Install cargo-binstall + uses: taiki-e/install-action@v2 + with: + tool: cargo-binstall + - name: Install cargo-release run: cargo binstall -y cargo-release - - name: Publish & tag + - name: Publish & tag (patch bump) run: cargo release patch --no-confirm --execute # ───────────────────────────────────────────────────────────── -# 3. GitHub Release (runs on the tag push) +# 3. Build binaries for multiple platforms & draft GitHub Release (tag push) # ───────────────────────────────────────────────────────────── release: if: startsWith(github.ref, 'refs/tags/') - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - target: x86_64-apple-darwin - - os: macos-latest - target: aarch64-apple-darwin - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v2 + with: + draft: true + generate_release_notes: true + + # Build for Linux x86_64 + build-linux-x86_64: + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + env: + TARGET: x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v4 @@ -141,52 +138,264 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ - hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-${{ matrix.target }}-cargo- + ${{ runner.os }}-${{ env.TARGET }}-cargo- ${{ runner.os }}-cargo- - uses: dtolnay/rust-toolchain@stable with: - targets: ${{ matrix.target }} + targets: ${{ env.TARGET }} - - name: Extra Linux deps - if: matrix.os == 'ubuntu-latest' + - name: Install Linux build deps run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Add Apple target (cross-compile to ARM) - if: startsWith(matrix.target, 'aarch64-apple') - run: rustup target add aarch64-apple-darwin - - name: Build release binary run: | - cargo build --release --locked --target ${{ matrix.target }} - mkdir dist - cp target/${{ matrix.target }}/release/git-ai dist/ - tar -C dist -czf \ - git-ai-${{ matrix.target }}.tar.gz git-ai + cargo build --release --locked --target ${{ env.TARGET }} + mkdir -p dist + cp target/${{ env.TARGET }}/release/git-ai dist/ + cd dist + tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai + cd .. - - uses: actions/upload-artifact@v4 + - name: Upload binary to release + uses: softprops/action-gh-release@v2 with: - name: bin-${{ matrix.target }} - path: git-ai-${{ matrix.target }}.tar.gz - if-no-files-found: error + fail_on_unmatched_files: false + files: git-ai-${{ env.TARGET }}.tar.gz - publish-release: + # Build for other platforms only on tag releases + # The following jobs only run when a tag is pushed, not during PR testing + + # Build for Linux aarch64 + build-linux-aarch64: needs: release if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest + env: + TARGET: aarch64-unknown-linux-gnu + steps: + - uses: actions/checkout@v4 + + - name: Cache cargo + target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.TARGET }}-cargo- + ${{ runner.os }}-cargo- + + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ env.TARGET }} + + - name: Install cross-compilation dependencies + run: | + sudo apt-get update + sudo apt-get install -y pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross + + - name: Build release binary + run: | + PKG_CONFIG_ALLOW_CROSS=1 cargo build --release --locked --target ${{ env.TARGET }} + mkdir -p dist + cp target/${{ env.TARGET }}/release/git-ai dist/ + cd dist + tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai + cd .. + + - name: Upload binary to release + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: false + files: git-ai-${{ env.TARGET }}.tar.gz + + # Build for macOS x86_64 + build-macos-x86_64: + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: macos-latest + env: + TARGET: x86_64-apple-darwin steps: - - name: Download all target artifacts - uses: actions/download-artifact@v4 + - uses: actions/checkout@v4 + + - name: Cache cargo + target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.TARGET }}-cargo- + ${{ runner.os }}-cargo- + + - uses: dtolnay/rust-toolchain@stable with: - path: dist + targets: ${{ env.TARGET }} + + - name: Build release binary + run: | + cargo build --release --locked --target ${{ env.TARGET }} + mkdir -p dist + cp target/${{ env.TARGET }}/release/git-ai dist/ + cd dist + tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai + cd .. + + - name: Upload binary to release + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: false + files: git-ai-${{ env.TARGET }}.tar.gz + + # Build for macOS aarch64 (Apple Silicon) + build-macos-aarch64: + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: macos-latest + env: + TARGET: aarch64-apple-darwin + steps: + - uses: actions/checkout@v4 + + - name: Cache cargo + target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.TARGET }}-cargo- + ${{ runner.os }}-cargo- + + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ env.TARGET }} + + - name: Build release binary + run: | + cargo build --release --locked --target ${{ env.TARGET }} + mkdir -p dist + cp target/${{ env.TARGET }}/release/git-ai dist/ + cd dist + tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai + cd .. + + - name: Upload binary to release + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: false + files: git-ai-${{ env.TARGET }}.tar.gz + + # Build for Windows x86_64 + build-windows-x86_64: + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: windows-latest + env: + TARGET: x86_64-pc-windows-msvc + steps: + - uses: actions/checkout@v4 + + - name: Cache cargo + target + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ env.TARGET }}-cargo- + ${{ runner.os }}-cargo- + + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ env.TARGET }} + + - name: Build release binary + run: | + cargo build --release --locked --target %TARGET% + mkdir dist + copy target\%TARGET%\release\git-ai.exe dist\ + powershell Compress-Archive -Path dist\git-ai.exe -DestinationPath git-ai-%TARGET%.zip + shell: cmd + + - name: Upload binary to release + uses: softprops/action-gh-release@v2 + with: + fail_on_unmatched_files: false + files: git-ai-${{ env.TARGET }}.zip + + # Generate cargo-binstall compatible metadata + cargo-binstall-metadata: + needs: [build-linux-x86_64, build-linux-aarch64, build-macos-x86_64, build-macos-aarch64, build-windows-x86_64] + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get version from tag + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + + - name: Generate cargo-binstall metadata.json + run: | + cat > metadata.json << EOF + { + "name": "git-ai", + "version": "${{ env.VERSION }}", + "package": { + "targets": [ + { + "name": "git-ai", + "bins": ["git-ai"] + } + ], + "platforms": { + "x86_64-unknown-linux-gnu": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-unknown-linux-gnu.tar.gz" + } + }, + "aarch64-unknown-linux-gnu": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-aarch64-unknown-linux-gnu.tar.gz" + } + }, + "x86_64-apple-darwin": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-apple-darwin.tar.gz" + } + }, + "aarch64-apple-darwin": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-aarch64-apple-darwin.tar.gz" + } + }, + "x86_64-pc-windows-msvc": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-pc-windows-msvc.zip" + } + } + } + } + } + EOF - - name: Create / update GitHub Release + - name: Upload metadata.json to release uses: softprops/action-gh-release@v2 with: - fail_on_unmatched_files: true - files: dist/**/*.tar.gz + fail_on_unmatched_files: false + files: metadata.json From ce222b880ed64e71762162eb99f3eae2d8cdcc73 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:56:07 +0200 Subject: [PATCH 27/48] =?UTF-8?q?Update=20dependencies=20in=20Cargo.toml?= =?UTF-8?q?=20to=20latest=20versions=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 4 ++-- .github/workflows/release.yml | 0 .github/workflows/test-event.json | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/test-event.json diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 4ae9af3..c86c8ac 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -103,7 +103,7 @@ jobs: run: cargo binstall -y cargo-release - name: Publish & tag (patch bump) - run: cargo release patch --no-confirm --execute + run: cargo release minor --no-confirm --execute # ───────────────────────────────────────────────────────────── # 3. Build binaries for multiple platforms & draft GitHub Release (tag push) @@ -169,7 +169,7 @@ jobs: # Build for other platforms only on tag releases # The following jobs only run when a tag is pushed, not during PR testing - + # Build for Linux aarch64 build-linux-aarch64: needs: release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/test-event.json b/.github/workflows/test-event.json new file mode 100644 index 0000000..46895ae --- /dev/null +++ b/.github/workflows/test-event.json @@ -0,0 +1 @@ +{"ref":"refs/tags/v0.0.0-test"} From 25a2a3e97c8d492065331690c799fa94c64aaa14 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 03:58:38 +0200 Subject: [PATCH 28/48] =?UTF-8?q?Update=20git-ai=20crate=20to=20version=20?= =?UTF-8?q?0.1.15=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c86c8ac..283e59f 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -103,7 +103,7 @@ jobs: run: cargo binstall -y cargo-release - name: Publish & tag (patch bump) - run: cargo release minor --no-confirm --execute + run: cargo release minor --no-confirm --execute --allow-branch HEAD # ───────────────────────────────────────────────────────────── # 3. Build binaries for multiple platforms & draft GitHub Release (tag push) From f92514746fe997d2ce370b19835c48077ae0926d Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:01:58 +0200 Subject: [PATCH 29/48] =?UTF-8?q?Remove=20stale=20code=20and=20unused=20ex?= =?UTF-8?q?clude=20files=20logic=20in=20git=20module=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 283e59f..b206ee4 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -102,6 +102,11 @@ jobs: - name: Install cargo-release run: cargo binstall -y cargo-release + - name: Git config + run: | + git config user.name ${{ github.actor }} + git config user.email ${{ github.actor }}@users.noreply.github.com + - name: Publish & tag (patch bump) run: cargo release minor --no-confirm --execute --allow-branch HEAD From ed961aa3a439f4234b7a046f02567c58eee7b091 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:07:42 +0200 Subject: [PATCH 30/48] =?UTF-8?q?Uncomment=20crates.io=20publish=20step=20?= =?UTF-8?q?in=20CD=20workflow=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index b206ee4..62cf06e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -40,8 +40,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ - hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-${{ env.TARGET }}-cargo- ${{ runner.os }}-cargo- @@ -88,8 +87,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ - hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- - uses: dtolnay/rust-toolchain@stable @@ -108,7 +106,7 @@ jobs: git config user.email ${{ github.actor }}@users.noreply.github.com - name: Publish & tag (patch bump) - run: cargo release minor --no-confirm --execute --allow-branch HEAD + run: cargo release minor --no-confirm --execute --allow-branch main # ───────────────────────────────────────────────────────────── # 3. Build binaries for multiple platforms & draft GitHub Release (tag push) From f98d1aea98f79115a73c02aa41fc7c6dc35a8749 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:09:44 +0200 Subject: [PATCH 31/48] =?UTF-8?q?Update=20record.sh=20to=20include=20git?= =?UTF-8?q?=20AI=20commands=20in=20demo=20recording=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 944b5da..8a0dfb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,9 @@ name: CI on: - pull_request: - types: [opened, synchronize, reopened] + workflow_dispatch: + # pull_request: + # types: [opened, synchronize, reopened] concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 97985191111eb4e46aa0fd6ba4a919b003b533aa Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:10:33 +0200 Subject: [PATCH 32/48] =?UTF-8?q?Update=20emoji=20color=20in=20log=20messa?= =?UTF-8?q?ge=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b58be6..1773494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-ai" -version = "1.0.11" +version = "1.2.0" dependencies = [ "anyhow", "async-openai", diff --git a/Cargo.toml b/Cargo.toml index afc134b..dec059d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-ai" -version = "1.0.11" +version = "1.2.0" edition = "2021" description = "Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages." license = "MIT" From 0abb28f5295763c0edd405d835d59674a88f1071 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:16:09 +0200 Subject: [PATCH 33/48] =?UTF-8?q?Add=20CONTRIBUTING.md=20with=20guidelines?= =?UTF-8?q?=20for=20contributing=20to=20Git=20AI=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 62cf06e..38ce843 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -157,7 +157,7 @@ jobs: - name: Build release binary run: | - cargo build --release --locked --target ${{ env.TARGET }} + cargo build --release --locked --target ${{ env.TARGET }} --bins mkdir -p dist cp target/${{ env.TARGET }}/release/git-ai dist/ cd dist From 9bcdacb92651a9818aac193a9859c7735ba7511f Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:17:29 +0200 Subject: [PATCH 34/48] =?UTF-8?q?Rename=20.rustfmt.toml=20to=20rustfmt.tom?= =?UTF-8?q?l=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 38ce843..678cbb9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -247,7 +247,8 @@ jobs: - name: Build release binary run: | - cargo build --release --locked --target ${{ env.TARGET }} + git checkout main + cargo build --release --locked --target ${{ env.TARGET }} --bins mkdir -p dist cp target/${{ env.TARGET }}/release/git-ai dist/ cd dist From 02df2bf9e438cfce1842b5ef4a68e63d524541d6 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:19:11 +0200 Subject: [PATCH 35/48] =?UTF-8?q?Set=20default=20values=20for=20CLI=20args?= =?UTF-8?q?,=20improve=20API=20key=20retrieval=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 678cbb9..18505c6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -248,12 +248,13 @@ jobs: - name: Build release binary run: | git checkout main - cargo build --release --locked --target ${{ env.TARGET }} --bins mkdir -p dist - cp target/${{ env.TARGET }}/release/git-ai dist/ + cargo build --release --locked --target ${{ env.TARGET }} --bins + cp target/${{ env.TARGET }}/release/git-ai* dist/ cd dist tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai cd .. + git checkout - - name: Upload binary to release uses: softprops/action-gh-release@v2 From cc18622169ed6ba629be405dc40f7a6ae48ee847 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:25:36 +0200 Subject: [PATCH 36/48] =?UTF-8?q?Add=20release=20script=20to=20automate=20?= =?UTF-8?q?the=20versioning=20and=20tagging=20process=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 440 ++++++++++----------------------------- 1 file changed, 109 insertions(+), 331 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 18505c6..cf26cc9 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,406 +1,184 @@ name: CD on: - pull_request: # CI + (optional) publish push: - tags: ['v*'] # create GitHub Release + branches: + - main workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: false permissions: contents: write - actions: write + actions: write packages: write env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} ACTIONS_RUNTIME_TOKEN: dummy - CARGO_TERM_COLOR: always + CARGO_TERM_COLOR: always + RUST_CACHE_VERSION: 1 # Increment to bust cache jobs: -# ───────────────────────────────────────────────────────────── -# 1. CI build (PR only) – single target -# ───────────────────────────────────────────────────────────── artifact: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - env: - TARGET: x86_64-unknown-linux-gnu + runs-on: ${{ matrix.os }} + continue-on-error: false + strategy: + matrix: + include: + - os: macos-latest + target: x86_64-apple-darwin + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: macos-latest + target: aarch64-apple-darwin + - os: ubuntu-latest + target: x86_64-unknown-linux-musl steps: - uses: actions/checkout@v4 - - name: Cache cargo + target + - name: Cache cargo registry uses: actions/cache@v4 with: path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + key: ${{ runner.os }}-${{ matrix.target }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- - - - uses: dtolnay/rust-toolchain@nightly - with: - targets: ${{ env.TARGET }} + ${{ runner.os }}-${{ matrix.target }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}- + ${{ runner.os }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}- - - name: Install Linux build deps - run: | - sudo apt-get update - sudo apt-get install -y pkg-config libssl-dev - - - name: Build - run: | - cargo build \ - -Z unstable-options \ - --profile release-with-debug \ - --artifact-dir bin \ - --target ${{ env.TARGET }} - - - uses: actions/upload-artifact@v4 + - name: Cache cargo target + uses: actions/cache@v4 with: - name: git-ai-${{ env.TARGET }} - path: bin/git-* - if-no-files-found: error - -# ───────────────────────────────────────────────────────────── -# 2. Publish crate **from PR** (same-repo branches only) -# ───────────────────────────────────────────────────────────── - publish-crate: - needs: artifact - if: > - github.event_name == 'pull_request' && - github.event.pull_request.head.repo.full_name == github.repository - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + path: target + key: ${{ runner.os }}-${{ matrix.target }}-cargo-target-${{ env.RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/*.rs') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.target }}-cargo-target-${{ env.RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }}- + ${{ runner.os }}-${{ matrix.target }}-cargo-target-${{ env.RUST_CACHE_VERSION }}- - - name: Cache cargo + - name: Cache Rust toolchain uses: actions/cache@v4 with: path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo- - - - uses: dtolnay/rust-toolchain@stable + ~/.rustup/toolchains + ~/.rustup/update-hashes + ~/.rustup/settings.toml + key: ${{ runner.os }}-rust-toolchain-nightly-${{ matrix.target }} + restore-keys: | + ${{ runner.os }}-rust-toolchain-nightly- + ${{ runner.os }}-rust-toolchain- - - name: Install cargo-binstall - uses: taiki-e/install-action@v2 + - name: Setup Rust + uses: dtolnay/rust-toolchain@nightly with: - tool: cargo-binstall - - - name: Install cargo-release - run: cargo binstall -y cargo-release + targets: ${{ matrix.target }} - - name: Git config + - name: Add x86_64-unknown-linux-musl target + if: matrix.target == 'x86_64-unknown-linux-musl' run: | - git config user.name ${{ github.actor }} - git config user.email ${{ github.actor }}@users.noreply.github.com - - - name: Publish & tag (patch bump) - run: cargo release minor --no-confirm --execute --allow-branch main - -# ───────────────────────────────────────────────────────────── -# 3. Build binaries for multiple platforms & draft GitHub Release (tag push) -# ───────────────────────────────────────────────────────────── - release: - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Create GitHub Release - id: create_release - uses: softprops/action-gh-release@v2 - with: - draft: true - generate_release_notes: true - - # Build for Linux x86_64 - build-linux-x86_64: - needs: release - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - env: - TARGET: x86_64-unknown-linux-gnu - steps: - - uses: actions/checkout@v4 - - - name: Cache cargo + target - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- + rustup target add x86_64-unknown-linux-musl + sudo apt-get update && sudo apt-get install -y musl-tools - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ env.TARGET }} + - name: Install Dependencies for musl Target + if: matrix.target == 'x86_64-unknown-linux-musl' + run: | + sudo apt-get update + sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev + echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV + echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV - - name: Install Linux build deps + - name: Install Dependencies for Linux Target + if: matrix.target == 'x86_64-unknown-linux-gnu' run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - - name: Build release binary + - name: Build for target run: | - cargo build --release --locked --target ${{ env.TARGET }} --bins - mkdir -p dist - cp target/${{ env.TARGET }}/release/git-ai dist/ - cd dist - tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai - cd .. + cargo build \ + -Z unstable-options \ + --profile release-with-debug \ + --artifact-dir bin \ + --target ${{ matrix.target }} - - name: Upload binary to release - uses: softprops/action-gh-release@v2 + - name: Upload and compress artifacts + uses: actions/upload-artifact@v4 with: - fail_on_unmatched_files: false - files: git-ai-${{ env.TARGET }}.tar.gz - - # Build for other platforms only on tag releases - # The following jobs only run when a tag is pushed, not during PR testing + name: git-ai-${{ matrix.target }} + if-no-files-found: error + path: bin/git-* - # Build for Linux aarch64 - build-linux-aarch64: - needs: release - if: startsWith(github.ref, 'refs/tags/') + release: runs-on: ubuntu-latest - env: - TARGET: aarch64-unknown-linux-gnu + needs: artifact steps: - uses: actions/checkout@v4 - - name: Cache cargo + target + - name: Cache cargo registry uses: actions/cache@v4 with: path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + key: ${{ runner.os }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ env.TARGET }} - - - name: Install cross-compilation dependencies - run: | - sudo apt-get update - sudo apt-get install -y pkg-config gcc-aarch64-linux-gnu libc6-dev-arm64-cross - - - name: Build release binary - run: | - PKG_CONFIG_ALLOW_CROSS=1 cargo build --release --locked --target ${{ env.TARGET }} - mkdir -p dist - cp target/${{ env.TARGET }}/release/git-ai dist/ - cd dist - tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai - cd .. - - - name: Upload binary to release - uses: softprops/action-gh-release@v2 - with: - fail_on_unmatched_files: false - files: git-ai-${{ env.TARGET }}.tar.gz - - # Build for macOS x86_64 - build-macos-x86_64: - needs: release - if: startsWith(github.ref, 'refs/tags/') - runs-on: macos-latest - env: - TARGET: x86_64-apple-darwin - steps: - - uses: actions/checkout@v4 + ${{ runner.os }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}- - - name: Cache cargo + target + - name: Cache cargo target uses: actions/cache@v4 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} + path: target + key: ${{ runner.os }}-cargo-target-release-${{ env.RUST_CACHE_VERSION }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- - - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ env.TARGET }} - - - name: Build release binary - run: | - git checkout main - mkdir -p dist - cargo build --release --locked --target ${{ env.TARGET }} --bins - cp target/${{ env.TARGET }}/release/git-ai* dist/ - cd dist - tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai - cd .. - git checkout - + ${{ runner.os }}-cargo-target-release-${{ env.RUST_CACHE_VERSION }}- - - name: Upload binary to release - uses: softprops/action-gh-release@v2 - with: - fail_on_unmatched_files: false - files: git-ai-${{ env.TARGET }}.tar.gz - - # Build for macOS aarch64 (Apple Silicon) - build-macos-aarch64: - needs: release - if: startsWith(github.ref, 'refs/tags/') - runs-on: macos-latest - env: - TARGET: aarch64-apple-darwin - steps: - - uses: actions/checkout@v4 - - - name: Cache cargo + target + - name: Cache cargo-binstall uses: actions/cache@v4 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- + path: ~/.cargo/bin/cargo-binstall + key: ${{ runner.os }}-cargo-binstall-${{ env.RUST_CACHE_VERSION }} - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ env.TARGET }} - - - name: Build release binary - run: | - cargo build --release --locked --target ${{ env.TARGET }} - mkdir -p dist - cp target/${{ env.TARGET }}/release/git-ai dist/ - cd dist - tar -czf ../git-ai-${{ env.TARGET }}.tar.gz git-ai - cd .. - - - name: Upload binary to release - uses: softprops/action-gh-release@v2 - with: - fail_on_unmatched_files: false - files: git-ai-${{ env.TARGET }}.tar.gz - - # Build for Windows x86_64 - build-windows-x86_64: - needs: release - if: startsWith(github.ref, 'refs/tags/') - runs-on: windows-latest - env: - TARGET: x86_64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Cache cargo + target - uses: actions/cache@v4 + - name: Install cargo-binstall + uses: taiki-e/install-action@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-${{ env.TARGET }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ env.TARGET }}-cargo- - ${{ runner.os }}-cargo- + tool: cargo-binstall - - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ env.TARGET }} + - name: Install cargo-release + run: cargo binstall -y cargo-release - - name: Build release binary + - name: Git config run: | - cargo build --release --locked --target %TARGET% - mkdir dist - copy target\%TARGET%\release\git-ai.exe dist\ - powershell Compress-Archive -Path dist\git-ai.exe -DestinationPath git-ai-%TARGET%.zip - shell: cmd - - - name: Upload binary to release - uses: softprops/action-gh-release@v2 - with: - fail_on_unmatched_files: false - files: git-ai-${{ env.TARGET }}.zip + git config user.name ${{ github.actor }} + git config user.email ${{ github.actor }}@users.noreply.github.com - # Generate cargo-binstall compatible metadata - cargo-binstall-metadata: - needs: [build-linux-x86_64, build-linux-aarch64, build-macos-x86_64, build-macos-aarch64, build-windows-x86_64] - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + - name: Publish & tag (patch bump) + run: cargo release patch --no-confirm --execute - - name: Get version from tag - id: get_version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + - name: Download all artifacts + run: gh run download ${{ github.run_id }} - - name: Generate cargo-binstall metadata.json + - name: Zip each downloaded directory run: | - cat > metadata.json << EOF - { - "name": "git-ai", - "version": "${{ env.VERSION }}", - "package": { - "targets": [ - { - "name": "git-ai", - "bins": ["git-ai"] - } - ], - "platforms": { - "x86_64-unknown-linux-gnu": { - "bins": { - "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-unknown-linux-gnu.tar.gz" - } - }, - "aarch64-unknown-linux-gnu": { - "bins": { - "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-aarch64-unknown-linux-gnu.tar.gz" - } - }, - "x86_64-apple-darwin": { - "bins": { - "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-apple-darwin.tar.gz" - } - }, - "aarch64-apple-darwin": { - "bins": { - "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-aarch64-apple-darwin.tar.gz" - } - }, - "x86_64-pc-windows-msvc": { - "bins": { - "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}/git-ai-x86_64-pc-windows-msvc.zip" - } - } - } - } - } - EOF + for dir in $(ls -d git-ai-*); do + tar -czf ${dir}.tar.gz ${dir} + done + + - name: Get version + id: app + run: echo "version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT - - name: Upload metadata.json to release + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - fail_on_unmatched_files: false - files: metadata.json + tag_name: v${{ steps.app.outputs.version }} + fail_on_unmatched_files: true + files: git-ai-*.tar.gz + generate_release_notes: true From ffaa7e2c4daecd30c0045080945b74dfe24a7f69 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:25:49 +0200 Subject: [PATCH 37/48] =?UTF-8?q?Update=20config=20handling=20and=20add=20?= =?UTF-8?q?`home`=20crate=20dependency=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index cf26cc9..9129190 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -20,7 +20,7 @@ env: GH_TOKEN: ${{ secrets.GH_TOKEN }} ACTIONS_RUNTIME_TOKEN: dummy CARGO_TERM_COLOR: always - RUST_CACHE_VERSION: 1 # Increment to bust cache + RUST_CACHE_VERSION: 1 jobs: artifact: From ff8175554756af06094420fc480ebd21fa1534d9 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:27:31 +0200 Subject: [PATCH 38/48] =?UTF-8?q?Update=20git-ai=20version=20and=20tag=20n?= =?UTF-8?q?ame=20in=20workflow=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9129190..094bbb1 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -159,6 +159,9 @@ jobs: git config user.name ${{ github.actor }} git config user.email ${{ github.actor }}@users.noreply.github.com + - name: Checkout main + run: git checkout main + - name: Publish & tag (patch bump) run: cargo release patch --no-confirm --execute From 77bb081e1da6d28f55d6a08ab45371c60efa0239 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:27:49 +0200 Subject: [PATCH 39/48] =?UTF-8?q?Remove=20redundant=20comments=20in=20patc?= =?UTF-8?q?h=5Ftest.rs=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 094bbb1..1d90fce 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -163,7 +163,7 @@ jobs: run: git checkout main - name: Publish & tag (patch bump) - run: cargo release patch --no-confirm --execute + run: cargo release patch --no-confirm --execute --allow-branch main - name: Download all artifacts run: gh run download ${{ github.run_id }} From 86f78a004c1ed799f181443dffff0f6a1a885150 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:28:07 +0200 Subject: [PATCH 40/48] =?UTF-8?q?Update=20GitHub=20CI=20Workflow=20?= =?UTF-8?q?=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1d90fce..0a6dcf4 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -163,7 +163,7 @@ jobs: run: git checkout main - name: Publish & tag (patch bump) - run: cargo release patch --no-confirm --execute --allow-branch main + run: cargo release minor --no-confirm --execute --allow-branch main - name: Download all artifacts run: gh run download ${{ github.run_id }} diff --git a/Cargo.lock b/Cargo.lock index 1773494..31672d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -674,7 +674,7 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "git-ai" -version = "1.2.0" +version = "1.3.0" dependencies = [ "anyhow", "async-openai", diff --git a/Cargo.toml b/Cargo.toml index dec059d..c9b2dcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "git-ai" -version = "1.2.0" +version = "1.3.0" edition = "2021" description = "Git AI: Automates commit messages using ChatGPT. Stage your files, and Git AI generates the messages." license = "MIT" From d1516282d570b206eb207611f790a7adbac9077a Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:29:06 +0200 Subject: [PATCH 41/48] =?UTF-8?q?Simplify=20release=20process=20and=20test?= =?UTF-8?q?=20workflow=20in=20Justfile=20and=20release=20script=20?= =?UTF-8?q?=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0a6dcf4..d38e77d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -162,7 +162,7 @@ jobs: - name: Checkout main run: git checkout main - - name: Publish & tag (patch bump) + - name: Build & publish run: cargo release minor --no-confirm --execute --allow-branch main - name: Download all artifacts From 535ce346b56930103be77a073507f32147dcfb0f Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:33:30 +0200 Subject: [PATCH 42/48] =?UTF-8?q?Simplify=20README=20content=20and=20reorg?= =?UTF-8?q?anize=20installation=20instructions=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 90 +++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d38e77d..5edba5e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: CD +name: Build & Release on: push: @@ -106,10 +106,32 @@ jobs: --artifact-dir bin \ --target ${{ matrix.target }} - - name: Upload and compress artifacts + - name: Package artifacts + run: | + mkdir -p dist + if [[ "${{ matrix.target }}" == *"-windows-"* ]]; then + cp bin/git-ai.exe dist/ + cd dist + zip -r ../git-ai-${{ matrix.target }}.zip . + cd .. + else + cp bin/git-ai dist/ + cd dist + tar -czf ../git-ai-${{ matrix.target }}.tar.gz . + cd .. + fi + + - name: Upload packaged artifacts + uses: actions/upload-artifact@v4 + with: + name: git-ai-${{ matrix.target }}-package + if-no-files-found: error + path: git-ai-${{ matrix.target }}.* + + - name: Upload raw artifacts uses: actions/upload-artifact@v4 with: - name: git-ai-${{ matrix.target }} + name: git-ai-${{ matrix.target }}-raw if-no-files-found: error path: bin/git-* @@ -165,23 +187,63 @@ jobs: - name: Build & publish run: cargo release minor --no-confirm --execute --allow-branch main - - name: Download all artifacts - run: gh run download ${{ github.run_id }} - - - name: Zip each downloaded directory - run: | - for dir in $(ls -d git-ai-*); do - tar -czf ${dir}.tar.gz ${dir} - done + - name: Download all packaged artifacts + uses: actions/download-artifact@v4 + with: + pattern: git-ai-*-package + path: packages + merge-multiple: true - name: Get version id: app run: echo "version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT + - name: Generate cargo-binstall metadata.json + run: | + cat > metadata.json << EOF + { + "name": "git-ai", + "version": "${{ steps.app.outputs.version }}", + "package": { + "targets": [ + { + "name": "git-ai", + "bins": ["git-ai"] + } + ], + "platforms": { + "x86_64-unknown-linux-gnu": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.app.outputs.version }}/git-ai-x86_64-unknown-linux-gnu.tar.gz" + } + }, + "x86_64-unknown-linux-musl": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.app.outputs.version }}/git-ai-x86_64-unknown-linux-musl.tar.gz" + } + }, + "x86_64-apple-darwin": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.app.outputs.version }}/git-ai-x86_64-apple-darwin.tar.gz" + } + }, + "aarch64-apple-darwin": { + "bins": { + "git-ai": "https://github.com/${{ github.repository }}/releases/download/v${{ steps.app.outputs.version }}/git-ai-aarch64-apple-darwin.tar.gz" + } + } + } + } + } + EOF + - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: v${{ steps.app.outputs.version }} - fail_on_unmatched_files: true - files: git-ai-*.tar.gz - generate_release_notes: true + fail_on_unmatched_files: false + files: | + packages/git-ai-*.tar.gz + packages/git-ai-*.zip + metadata.json + generate_release_notes: true \ No newline at end of file From 0260ac26bc120e35b45d421c583988c02b85d2f5 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 04:36:52 +0200 Subject: [PATCH 43/48] =?UTF-8?q?Enable=20patience=20diff=20algorithm=20an?= =?UTF-8?q?d=20clean=20up=20commented=20code=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 5edba5e..ed9e131 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -187,13 +187,22 @@ jobs: - name: Build & publish run: cargo release minor --no-confirm --execute --allow-branch main + - name: Create temporary directory for artifacts + run: mkdir -p ${{ runner.temp }}/artifacts + - name: Download all packaged artifacts uses: actions/download-artifact@v4 with: pattern: git-ai-*-package - path: packages + path: ${{ runner.temp }}/artifacts merge-multiple: true + - name: Move artifacts to packages directory + run: | + mkdir -p packages + # Move all artifacts from temp to packages directory + mv ${{ runner.temp }}/artifacts/* packages/ + - name: Get version id: app run: echo "version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')" >> $GITHUB_OUTPUT @@ -246,4 +255,4 @@ jobs: packages/git-ai-*.tar.gz packages/git-ai-*.zip metadata.json - generate_release_notes: true \ No newline at end of file + generate_release_notes: true From 06f666cd696b4b4dbc42d09e3172c17c3dc3075c Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 05:35:06 +0200 Subject: [PATCH 44/48] =?UTF-8?q?=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/comprehensive-tests | 0 scripts/current-version | 0 scripts/hook-stress-test | 0 scripts/integration-tests | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 scripts/comprehensive-tests mode change 100755 => 100644 scripts/current-version mode change 100755 => 100644 scripts/hook-stress-test mode change 100755 => 100644 scripts/integration-tests diff --git a/scripts/comprehensive-tests b/scripts/comprehensive-tests old mode 100755 new mode 100644 diff --git a/scripts/current-version b/scripts/current-version old mode 100755 new mode 100644 diff --git a/scripts/hook-stress-test b/scripts/hook-stress-test old mode 100755 new mode 100644 diff --git a/scripts/integration-tests b/scripts/integration-tests old mode 100755 new mode 100644 From 48ece0060f35febb24a80386a69216b9cdf98ccc Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 05:57:14 +0200 Subject: [PATCH 45/48] Update CD workflow --- .github/workflows/cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ed9e131..e841245 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -82,7 +82,7 @@ jobs: if: matrix.target == 'x86_64-unknown-linux-musl' run: | rustup target add x86_64-unknown-linux-musl - sudo apt-get update && sudo apt-get install -y musl-tools + sudo apt-get update && sudo apt-get install -y musl-tools git - name: Install Dependencies for musl Target if: matrix.target == 'x86_64-unknown-linux-musl' @@ -136,7 +136,7 @@ jobs: path: bin/git-* release: - runs-on: ubuntu-latest + runs-on: macos-latest needs: artifact steps: - uses: actions/checkout@v4 From f71eb1b60c52ae3082c0b38b63ca50e71418ba51 Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 07:17:48 +0200 Subject: [PATCH 46/48] =?UTF-8?q?Update=20CD=20workflow=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cargo/config.toml | 6 +++ .github/workflows/cd.yml | 74 ++++++++++++++++++++++++++++--- docs/LOCAL_TESTING.md | 96 ++++++++++++++++++++++++++++++++++++++++ scripts/act-local.sh | 49 ++++++++++++++++++++ 4 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 docs/LOCAL_TESTING.md create mode 100755 scripts/act-local.sh diff --git a/.cargo/config.toml b/.cargo/config.toml index 8d1e389..ae406fd 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,9 @@ [env] TMPDIR = "/tmp" + +[target.x86_64-unknown-linux-musl] +linker = "musl-gcc" + +[target.x86_64-unknown-linux-musl.openssl-sys] +rustc-link-lib = ["static=ssl", "static=crypto"] diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e841245..97fb8ae 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -38,9 +38,32 @@ jobs: - os: ubuntu-latest target: x86_64-unknown-linux-musl steps: + - name: Check if should skip this matrix combination + id: check_skip + run: | + # Skip macOS targets when running in act (Linux containers) + if [[ -n "${ACT}" && "${{ matrix.os }}" == "macos-latest" ]]; then + echo "skip=true" >> $GITHUB_OUTPUT + echo "Skipping macOS target in act environment" + else + echo "skip=false" >> $GITHUB_OUTPUT + fi + - uses: actions/checkout@v4 + if: steps.check_skip.outputs.skip != 'true' + + - name: Install Node.js for act + if: steps.check_skip.outputs.skip != 'true' && env.ACT == 'true' + run: | + # Install Node.js manually in act container + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - + sudo apt-get install -y nodejs + # Verify installation + node --version + npm --version - name: Cache cargo registry + if: steps.check_skip.outputs.skip != 'true' uses: actions/cache@v4 with: path: | @@ -53,6 +76,7 @@ jobs: ${{ runner.os }}-cargo-registry-${{ env.RUST_CACHE_VERSION }}- - name: Cache cargo target + if: steps.check_skip.outputs.skip != 'true' uses: actions/cache@v4 with: path: target @@ -62,6 +86,7 @@ jobs: ${{ runner.os }}-${{ matrix.target }}-cargo-target-${{ env.RUST_CACHE_VERSION }}- - name: Cache Rust toolchain + if: steps.check_skip.outputs.skip != 'true' uses: actions/cache@v4 with: path: | @@ -73,32 +98,68 @@ jobs: ${{ runner.os }}-rust-toolchain-nightly- ${{ runner.os }}-rust-toolchain- + - name: Install Node + if: steps.check_skip.outputs.skip != 'true' + uses: actions/setup-node@v4 + - name: Setup Rust + if: steps.check_skip.outputs.skip != 'true' uses: dtolnay/rust-toolchain@nightly with: targets: ${{ matrix.target }} + - name: Check if running in act + id: check_act + if: steps.check_skip.outputs.skip != 'true' + run: | + if [[ -n "${ACT}" ]]; then + echo "running_in_act=true" >> $GITHUB_OUTPUT + else + echo "running_in_act=false" >> $GITHUB_OUTPUT + fi + + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Add x86_64-unknown-linux-musl target - if: matrix.target == 'x86_64-unknown-linux-musl' + if: matrix.target == 'x86_64-unknown-linux-musl' && steps.check_act.outputs.running_in_act != 'true' && steps.check_skip.outputs.skip != 'true' run: | rustup target add x86_64-unknown-linux-musl - sudo apt-get update && sudo apt-get install -y musl-tools git + sudo apt-get update && sudo apt-get install -y musl-tools - name: Install Dependencies for musl Target - if: matrix.target == 'x86_64-unknown-linux-musl' + if: matrix.target == 'x86_64-unknown-linux-musl' && steps.check_act.outputs.running_in_act != 'true' && steps.check_skip.outputs.skip != 'true' run: | sudo apt-get update - sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev + sudo apt-get install -y musl-tools musl-dev perl make pkg-config + # Set up environment for musl cross-compilation echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV + # Configure OpenSSL build to avoid -m64 flag + echo "OPENSSL_STATIC=1" >> $GITHUB_ENV + echo "OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-musl" >> $GITHUB_ENV + echo "OPENSSL_INCLUDE_DIR=/usr/include" >> $GITHUB_ENV + + - name: Skip musl build in act + if: matrix.target == 'x86_64-unknown-linux-musl' && steps.check_act.outputs.running_in_act == 'true' && steps.check_skip.outputs.skip != 'true' + run: | + echo "Skipping musl build in act due to cross-compilation issues" + mkdir -p bin + echo '#!/bin/sh' > bin/git-ai + echo 'echo "Placeholder for musl build in act"' >> bin/git-ai + chmod +x bin/git-ai + cp bin/git-ai bin/git-ai-hook - name: Install Dependencies for Linux Target - if: matrix.target == 'x86_64-unknown-linux-gnu' + if: matrix.target == 'x86_64-unknown-linux-gnu' && steps.check_skip.outputs.skip != 'true' run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - name: Build for target + if: ${{ !(matrix.target == 'x86_64-unknown-linux-musl' && steps.check_act.outputs.running_in_act == 'true') && steps.check_skip.outputs.skip != 'true' }} run: | cargo build \ -Z unstable-options \ @@ -107,6 +168,7 @@ jobs: --target ${{ matrix.target }} - name: Package artifacts + if: steps.check_skip.outputs.skip != 'true' run: | mkdir -p dist if [[ "${{ matrix.target }}" == *"-windows-"* ]]; then @@ -122,6 +184,7 @@ jobs: fi - name: Upload packaged artifacts + if: steps.check_skip.outputs.skip != 'true' uses: actions/upload-artifact@v4 with: name: git-ai-${{ matrix.target }}-package @@ -129,6 +192,7 @@ jobs: path: git-ai-${{ matrix.target }}.* - name: Upload raw artifacts + if: steps.check_skip.outputs.skip != 'true' uses: actions/upload-artifact@v4 with: name: git-ai-${{ matrix.target }}-raw diff --git a/docs/LOCAL_TESTING.md b/docs/LOCAL_TESTING.md new file mode 100644 index 0000000..ace7bc7 --- /dev/null +++ b/docs/LOCAL_TESTING.md @@ -0,0 +1,96 @@ +# Local Testing with Act + +## Overview + +This document explains how to test GitHub Actions workflows locally using `act`. + +## Running Specific Matrix Combinations + +### Option 1: Using act filters (Recommended) + +To run only specific matrix combinations locally, use act's job filtering: + +```bash +# Run only the macOS x86_64 build +act -j artifact -W .github/workflows/cd.yml --matrix os:macos-latest --matrix target:x86_64-apple-darwin + +# Run only the Linux GNU build +act -j artifact -W .github/workflows/cd.yml --matrix os:ubuntu-latest --matrix target:x86_64-unknown-linux-gnu +``` + +### Option 2: Create a custom event file + +Create a file `.act.json` with specific matrix values: + +```json +{ + "workflow_dispatch": { + "inputs": { + "matrix_filter": "macos" + } + } +} +``` + +Then run: +```bash +act workflow_dispatch -e .act.json +``` + +## Known Issues + +### Cross-compilation for musl targets + +When running workflows locally with `act` on macOS, cross-compilation for `x86_64-unknown-linux-musl` targets will fail. This is because: + +1. `act` runs Linux containers on macOS +2. The build process tries to compile OpenSSL from source for musl +3. The OpenSSL build system incorrectly uses `-m64` flag with musl-gcc, which doesn't support it + +### Cross-compilation for macOS targets + +When running in `act` (Linux containers), you cannot build macOS targets (`x86_64-apple-darwin`, `aarch64-apple-darwin`) because: + +1. `act` runs in Linux containers +2. Cross-compiling from Linux to macOS requires Apple's SDK and toolchain +3. The compiler flags like `-arch` and `-mmacosx-version-min` are not recognized by Linux gcc + +### Solutions + +#### 1. Run only Linux targets locally + +The safest approach is to only test Linux targets locally: + +```bash +# Test Linux GNU target +act -j artifact -W .github/workflows/cd.yml --matrix os:ubuntu-latest --matrix target:x86_64-unknown-linux-gnu +``` + +#### 2. Skip problematic builds + +The main workflow automatically detects when running in `act` and skips musl builds. It will create placeholder binaries instead. + +#### 3. Test on real GitHub Actions + +Push your changes to a branch and let the real GitHub Actions runners handle the cross-compilation: + +```bash +git push origin feature/your-branch +``` + +## Configuration + +The `.actrc` file is configured to: +- Use appropriate container images +- Set up caching +- Enable the `ACT` environment variable for detection + +## Troubleshooting + +If you encounter issues: + +1. Ensure Docker is running +2. Update act to the latest version: `brew upgrade act` +3. Clear the cache: `rm -rf tmp/cache` +4. Check the `.actrc` configuration +5. Use `-v` flag for verbose output: `act -v` diff --git a/scripts/act-local.sh b/scripts/act-local.sh new file mode 100755 index 0000000..f5195ef --- /dev/null +++ b/scripts/act-local.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# Helper script to run specific matrix combinations with act + +set -e + +# Default to Linux GNU target +TARGET="${1:-linux-gnu}" + +case "$TARGET" in + "linux-gnu") + echo "Running Linux GNU build..." + act -j artifact -W .github/workflows/cd.yml \ + --matrix os:ubuntu-latest \ + --matrix target:x86_64-unknown-linux-gnu + ;; + "linux-musl") + echo "Running Linux musl build (will be skipped due to cross-compilation issues)..." + act -j artifact -W .github/workflows/cd.yml \ + --matrix os:ubuntu-latest \ + --matrix target:x86_64-unknown-linux-musl + ;; + "macos-x86") + echo "Running macOS x86_64 build (will be skipped in act)..." + act -j artifact -W .github/workflows/cd.yml \ + --matrix os:macos-latest \ + --matrix target:x86_64-apple-darwin + ;; + "macos-arm") + echo "Running macOS ARM64 build (will be skipped in act)..." + act -j artifact -W .github/workflows/cd.yml \ + --matrix os:macos-latest \ + --matrix target:aarch64-apple-darwin + ;; + "all") + echo "Running all builds (macOS targets will be skipped)..." + act -j artifact -W .github/workflows/cd.yml + ;; + *) + echo "Usage: $0 [linux-gnu|linux-musl|macos-x86|macos-arm|all]" + echo "" + echo "Available targets:" + echo " linux-gnu - Build for x86_64-unknown-linux-gnu (works in act)" + echo " linux-musl - Build for x86_64-unknown-linux-musl (skipped in act)" + echo " macos-x86 - Build for x86_64-apple-darwin (skipped in act)" + echo " macos-arm - Build for aarch64-apple-darwin (skipped in act)" + echo " all - Run all builds (only Linux GNU will actually build)" + exit 1 + ;; +esac From 12a4c0de9c9ea6bb3007ba10075437d29fdcf61e Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 07:18:30 +0200 Subject: [PATCH 47/48] =?UTF-8?q?Update=20CD=20workflow=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 97fb8ae..a714efe 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,6 +5,7 @@ on: branches: - main workflow_dispatch: + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 1d6f338d40662ad5e127282480c5e95b0e30977a Mon Sep 17 00:00:00 2001 From: Linus Oleander <220827+oleander@users.noreply.github.com> Date: Wed, 28 May 2025 07:33:41 +0200 Subject: [PATCH 48/48] =?UTF-8?q?Remove=20unused=20dependencies=20from=20C?= =?UTF-8?q?argo.toml=20and=20Cargo.lock=20=F0=9F=A4=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a714efe..cc49ead 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -205,6 +205,9 @@ jobs: needs: artifact steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main - name: Cache cargo registry uses: actions/cache@v4