Skip to content

Commit

Permalink
Update Cargo.toml with new targets; enhance CI workflow steps
Browse files Browse the repository at this point in the history
  • Loading branch information
oleander committed Nov 16, 2024
1 parent 82e94a0 commit bfb5f70
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ env:
jobs:
build:
runs-on: macos-latest
continue-on-error: false
steps:
- uses: actions/checkout@v4

- name: Ensure no changes (1)
continue-on-error: true
run: git diff --exit-code --quiet && cargo check

- name: Git status
if: failure()
run: git status && exit 1

- name: Setup Git
run: |
git config user.name "Linus Oleander"
Expand All @@ -46,7 +55,6 @@ jobs:
run: cargo install cargo-bump

- name: Ensure no changes
continue-on-error: true
run: git diff --exit-code --quiet && cargo check

- name: Git status
Expand All @@ -57,8 +65,8 @@ jobs:
run: cargo bump patch --git-tag || git status

- name: Get the latest tag
id: version
run: git describe --tags --abbrev=0 HEAD
id: version

- name: Include the version bump in the commit message
run: git commit -a --amend --no-edit
Expand All @@ -69,13 +77,22 @@ jobs:
- name: Build for target (${{ env.TARGET }})
run: cargo build -Z unstable-options --profile dev --artifact-dir bin --target ${{ env.TARGET }}

- name: List all targets
run: |
ls -halt bin/
pwd
realpath bin/
- name: Upload Binary
uses: actions/upload-artifact@v4
id: upload-artifact
with:
name: v${{ steps.version.outputs.version }}-${{ runner.os }}
path: bin/{git-ai,git-ai-hook}
if-no-files-found: error
overwrite: true
path: bin/{git-ai,git-ai-hook}

- name: Print the artifact URL
run: echo ${{ steps.upload-artifact.outputs.artifact-url }}

- name: Push to origin
run: git push origin HEAD
8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ repository = "https://github.com/oleander/git-ai"
[package.metadata.binstall]
name = "git-ai"
default-target = "x86_64-apple-darwin"
targets = ["x86_64-apple-darwin"]
pkg-url = "{ repo_url }/releases/download/{ version }/{ name }-{ target }{ archive-suffix }"
pkg-fmt = "zip"
targets = ["aarch64-unknown-linux-gnu", "x86_64-apple-darwin"]
pkg-url = "{ repo_url }/releases/download/v{ version }/{ name }-{ target }"
pkg-fmt = "bin"
bin-dir = "bin"
pkg-binaries = ["git-ai", "git-ai-hook"]

[lib]
name = "ai"
Expand Down

0 comments on commit bfb5f70

Please sign in to comment.