Skip to content

Commit

Permalink
Add ahnlich cli as part of the releases for docker images and github …
Browse files Browse the repository at this point in the history
…actions
  • Loading branch information
Iamdavidonuh committed Sep 29, 2024
1 parent a0e2877 commit f7dfd24
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ jobs:
- name: Setup Zig
uses: goto-bus-stop/setup-zig@v2

- name: Build Linux Release for ${{ steps.get_binary_version.outputs.BIN_NAME }}
- name: Build Linux Release for ${{ steps.get_binary_version.outputs.BIN_NAME }} And CLI
working-directory: ./ahnlich
run: |
cargo build --release --bin ${{ steps.get_binary_version.outputs.BIN_NAME }}
tar -cvzf linux-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz -C target/release ${{ steps.get_binary_version.outputs.BIN_NAME }}
cargo build --release --bin ahnlich_cli
tar -cvzf linux-ahnlich_cli.tar.gz -C target/release ahnlich_cli
gh release upload ${{github.event.release.tag_name}} linux-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz
gh release upload ${{github.event.release.tag_name}} linux-ahnlich_cli.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
shell: bash
Expand All @@ -53,24 +59,34 @@ jobs:
run: |
cargo install --locked cargo-zigbuild
- name: Build Aarch64 Darwin Release for ${{ steps.get_binary_version.outputs.BIN_NAME }}
- name: Build Aarch64 Darwin Release for ${{ steps.get_binary_version.outputs.BIN_NAME }} And CLI
working-directory: ./ahnlich
run: |
rustup target add aarch64-apple-darwin
cargo zigbuild --release --target aarch64-apple-darwin --bin ${{ steps.get_binary_version.outputs.BIN_NAME }}
tar -cvzf aarch64-darwin-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz -C target/aarch64-apple-darwin/release ${{ steps.get_binary_version.outputs.BIN_NAME }}
gh release upload ${{github.event.release.tag_name}} aarch64-darwin-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz
cargo zigbuild --release --target aarch64-apple-darwin --bin ahnlich_cli
tar -cvzf aarch64-darwin-ahnlich_cli.tar.gz -C target/aarch64-apple-darwin/release ahnlich_cli
gh release upload ${{github.event.release.tag_name}} aarch64-darwin-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz
gh release upload ${{github.event.release.tag_name}} aarch64-darwin-ahnlich_cli.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
shell: bash

- name: Build x86_64 Apple Darwin Release for ${{ steps.get_binary_version.outputs.BIN_NAME }}
- name: Build x86_64 Apple Darwin Release for ${{ steps.get_binary_version.outputs.BIN_NAME }} And CLI
working-directory: ./ahnlich
run: |
rustup target add x86_64-apple-darwin
cargo zigbuild --release --target x86_64-apple-darwin --bin ${{ steps.get_binary_version.outputs.BIN_NAME }}
tar -cvzf x86_64-apple-darwin-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz -C target/x86_64-apple-darwin/release ${{ steps.get_binary_version.outputs.BIN_NAME }}
cargo zigbuild --release --target x86_64-apple-darwin --bin ahnlich_cli
tar -cvzf x86_64-apple-darwin-ahnlich_cli.tar.gz -C target/x86_64-apple-darwin/release ahnlich_cli
gh release upload ${{github.event.release.tag_name}} x86_64-apple-darwin-${{ steps.get_binary_version.outputs.BIN_NAME }}.tar.gz
gh release upload ${{github.event.release.tag_name}} x86_64-apple-darwin-ahnlich_cli.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
shell: bash
Expand All @@ -89,11 +105,23 @@ jobs:
args: "--locked --release --bin ${{ steps.get_binary_version.outputs.BIN_NAME }}"
strip: true

- name: Package and upload x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_version.outputs.BIN_NAME }}
- name: Build Windows x86_64-pc-windows-gnu for Ahnlich CLI
uses: houseabsolute/actions-rust-cross@v0
with:
working-directory: ./ahnlich
command: build
target: x86_64-pc-windows-gnu
args: "--locked --release --bin ahnlich_cli"
strip: true

- name: Package and upload x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_version.outputs.BIN_NAME }} and CLI
working-directory: ./ahnlich
run: |
cd target/x86_64-pc-windows-gnu/release/ && zip ../../../win-x86_64-gnu-${{ steps.get_binary_version.outputs.BIN_NAME }}.zip ${{ steps.get_binary_version.outputs.BIN_NAME }}.exe && cd ../../../
cd target/x86_64-pc-windows-gnu/release/ && zip ../../../win-x86_64-gnu-ahnlich_cli.zip ahnlich_cli.exe && cd ../../../
gh release upload ${{github.event.release.tag_name}} win-x86_64-gnu-${{ steps.get_binary_version.outputs.BIN_NAME }}.zip
gh release upload ${{github.event.release.tag_name}} win-x86_64-gnu-ahnlich_cli.zip
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions ahnlich/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ COPY . /app/

# Build our project
RUN cargo build --release --bin ${AHNLICH_BIN}
RUN cargo build --release --bin ahnlich_cli


FROM debian:bookworm-slim AS runtime
Expand All @@ -37,6 +38,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-cert


COPY --from=builder /app/target/release/${AHNLICH_BIN} /usr/local/bin/
COPY --from=builder /app/target/release/ahnlich_cli /usr/local/bin/

ENV AHNLICH_BIN=${AHNLICH_BIN}

Expand Down

0 comments on commit f7dfd24

Please sign in to comment.