Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach binary to crate #20

Merged
merged 33 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9e787da
Consolidate workflow scripts and streamline CI/CD setup
oleander Nov 16, 2024
48e1449
Add 'feature/bundle-bin' branch to CD workflow trigger
oleander Nov 16, 2024
1454360
Add version bump workflow; refactor and simplify CD workflow
oleander Nov 16, 2024
c234dee
Update Git setup with custom user config in workflow
oleander Nov 16, 2024
76f0d20
Update 'bump.yml' to include '--build' in cargo bump command
oleander Nov 16, 2024
82d8fec
Remove duplicate cargo bump patch command
oleander Nov 16, 2024
86a88f1
Remove unnecessary permissions in workflows
oleander Nov 16, 2024
ee28d46
0.2.7
oleander Nov 16, 2024
419410f
Expand deployment events in CD workflow
oleander Nov 16, 2024
ed8f5f4
Add TMPDIR to .cargo/config.toml, update Cargo.lock version
oleander Nov 16, 2024
94a6922
Fix TMPDIR value by adding missing quotes
oleander Nov 16, 2024
0c35a56
0.2.8
oleander Nov 16, 2024
7728f53
Remove redundant event trigger wildcard in CD workflow
oleander Nov 16, 2024
fb210c5
Update git-ai to version 0.2.8 and GH release action to v2
oleander Nov 16, 2024
6338d1f
0.2.9
oleander Nov 16, 2024
c48df61
Add concurrency setting to GitHub Actions CD workflow
oleander Nov 16, 2024
a5d8612
Update git-ai version to 0.2.9 in Cargo.lock
oleander Nov 16, 2024
85ab68f
0.2.10
oleander Nov 16, 2024
0ab6f2d
Amend bump commit to include additional changes
oleander Nov 16, 2024
82382bc
0.2.11
oleander Nov 16, 2024
3dc96ca
Update bump.yml workflow file
oleander Nov 16, 2024
8a35711
Enable workflow on all branches and update tag_name variable
oleander Nov 16, 2024
90bebc9
Update git-ai to version 0.2.11 and remove version extraction step
oleander Nov 16, 2024
d348936
Fix incorrect file paths in CD workflow configuration
oleander Nov 16, 2024
8a8d02c
0.2.12
oleander Nov 16, 2024
e25e87a
Refactor artifacts generation in CD workflow
oleander Nov 16, 2024
a0a2530
Upgrade git-ai to version 0.2.12 and fix tag_name usage in cd.yml
oleander Nov 16, 2024
5029442
0.2.13
oleander Nov 16, 2024
21a50d7
Fix variable reference in GitHub Actions workflow
oleander Nov 16, 2024
7c29396
Remove unused draft and prerelease settings
oleander Nov 16, 2024
e8b96f5
Update git-ai version and add stash step in workflow
oleander Nov 16, 2024
a9fa0aa
0.2.14
oleander Nov 16, 2024
db3a6fa
Update workflows to trigger on 'main' and add concurrency settings
oleander Nov 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[env]

TMPDIR = "/tmp"
39 changes: 39 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Bump Version

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Git
run: |
git config user.name "Linus Oleander"
git config user.email "[email protected]"

- name: Install cargo-bump
run: cargo install cargo-bump --force

- name: Bump version
run: |
git stash || echo "No changes to stash"
cargo bump patch --git-tag
git commit -a --amend --no-edit

- name: Push to GitHub
run: git push origin HEAD --tags
124 changes: 55 additions & 69 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,79 @@
name: CD

on:
pull_request:
types: [opened, synchronize, reopened]
push:
tags:
- "**"
branches:
- "main"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

env:
CARGO_TERM_COLOR: always

jobs:
lint:
build-x86:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup nightly toolchain
uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
toolchain: nightly
- name: Add target
run: rustup target add x86_64-unknown-linux-gnu

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-nightly-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Build for x86_64-unknown-linux-gnu
run: cargo build --release --target x86_64-unknown-linux-gnu

- name: Run cargo fmt
uses: actions-rs/cargo@v1
- name: Package Binary
run: tar czf target/*/release/git-ai-*.tar.gz git-*

- name: Upload Binary
uses: actions/upload-artifact@v4
with:
command: fmt
args: -- --check
test:
needs: lint
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest]
rust: [nightly, stable]
runs-on: ${{ matrix.os }}
continue-on-error: false
name: git-ai-x86_64-unknown-linux-gnu.tar.gz
path: git-ai-*.tar.gz

build-arm:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Add target
run: rustup target add aarch64-apple-darwin

- name: Set up Rust
uses: actions-rs/toolchain@v1
- name: Build for aarch64-apple-darwin
run: cargo build --release --target aarch64-apple-darwin

- name: Package Binary
run: tar czf target/*/release/git-ai-*.tar.gz git-*

- name: Upload Binary
uses: actions/upload-artifact@v4
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
name: git-ai-aarch64-apple-darwin.tar.gz
path: git-ai-*.tar.gz

- uses: actions/cache@v4
release:
needs: [build-x86, build-arm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v4

- name: Create Release
uses: softprops/action-gh-release@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.rust }}-

- name: Install fish on linux
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install fish

- name: Install fish on macos
if: startsWith(matrix.os, 'macos')
run: brew install fish

- name: Run integration tests
run: |
./scripts/integration-tests
cargo build --release
cargo test --release
files: git-ai-*.tar.gz
tag_name: ${{ github.ref_name }}

- name: Publish to crates.io
run: cargo publish
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI

on:
pull_request:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup nightly toolchain
uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
toolchain: nightly

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-nightly-${{ hashFiles('**/Cargo.lock') }}

- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
test:
needs: lint
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest]
rust: [nightly, stable]
runs-on: ${{ matrix.os }}
continue-on-error: false
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.rust }}-

- name: Install fish on linux
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install fish

- name: Install fish on macos
if: startsWith(matrix.os, 'macos')
run: brew install fish

- name: Run integration tests
run: |
./scripts/integration-tests
cargo build --release
cargo test --release
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
65 changes: 0 additions & 65 deletions .github/workflows/crate.yaml

This file was deleted.

Loading
Loading