diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99911b17..29ae23f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,14 +14,14 @@ jobs: name: Build Binaries runs-on: ubuntu-latest outputs: - bin_name: ${{ steps.get_binary_version.outputs.BIN_NAME }} - bin_suffix: ${{ steps.get_binary_version.outputs.BIN_SUFFIX }} + bin_name: ${{ steps.get_binary_type.outputs.BIN_NAME }} + bin_suffix: ${{ steps.get_binary_type.outputs.BIN_SUFFIX }} steps: - name: "Checkout" uses: actions/checkout@v4 - - name: "Get Binary Version" - id: get_binary_version + - name: "Get Binary Type" + id: get_binary_type run: | cd ${{github.workspace}} echo ${{ github.event.release.tag_name }} @@ -40,17 +40,12 @@ jobs: with: version: 0.13.0 - - name: Build Linux Release for ${{ steps.get_binary_version.outputs.BIN_NAME }} And CLI + - name: Build Linux Release for ${{ steps.get_binary_type.outputs.BIN_NAME }} 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 + cargo build --release --bin ${{ steps.get_binary_type.outputs.BIN_NAME }} + tar -cvzf linux-${{ steps.get_binary_type.outputs.BIN_NAME }}.tar.gz -C target/release ${{ steps.get_binary_type.outputs.BIN_NAME }} + gh release upload ${{github.event.release.tag_name}} linux-${{ steps.get_binary_type.outputs.BIN_NAME }}.tar.gz env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -61,34 +56,27 @@ jobs: run: | cargo install --locked cargo-zigbuild --version 0.19.1 - - name: Build Aarch64 Darwin Release for ${{ steps.get_binary_version.outputs.BIN_NAME }} And CLI + - name: Build Aarch64 Darwin Release for ${{ steps.get_binary_type.outputs.BIN_NAME }} 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 }} + cargo zigbuild --release --target aarch64-apple-darwin --bin ${{ steps.get_binary_type.outputs.BIN_NAME }} + tar -cvzf aarch64-darwin-${{ steps.get_binary_type.outputs.BIN_NAME }}.tar.gz -C target/aarch64-apple-darwin/release ${{ steps.get_binary_type.outputs.BIN_NAME }} + gh release upload ${{github.event.release.tag_name}} aarch64-darwin-${{ steps.get_binary_type.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 }} And CLI + - name: Build x86_64 Apple Darwin Release for ${{ steps.get_binary_type.outputs.BIN_NAME }} 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 + cargo zigbuild --release --target x86_64-apple-darwin --bin ${{ steps.get_binary_type.outputs.BIN_NAME }} + tar -cvzf x86_64-apple-darwin-${{ steps.get_binary_type.outputs.BIN_NAME }}.tar.gz -C target/x86_64-apple-darwin/release ${{ steps.get_binary_type.outputs.BIN_NAME }} + + gh release upload ${{github.event.release.tag_name}} x86_64-apple-darwin-${{ steps.get_binary_type.outputs.BIN_NAME }}.tar.gz - 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 @@ -98,32 +86,21 @@ jobs: run: | cargo install cross --git https://github.com/cross-rs/cross - - name: Build Windows x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_version.outputs.BIN_NAME }} - uses: houseabsolute/actions-rust-cross@v0 - with: - working-directory: ./ahnlich - command: build - target: x86_64-pc-windows-gnu - args: "--locked --release --bin ${{ steps.get_binary_version.outputs.BIN_NAME }}" - strip: true - - - name: Build Windows x86_64-pc-windows-gnu for Ahnlich CLI + - name: Build Windows x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_type.outputs.BIN_NAME }} uses: houseabsolute/actions-rust-cross@v0 with: working-directory: ./ahnlich command: build target: x86_64-pc-windows-gnu - args: "--locked --release --bin ahnlich_cli" + args: "--locked --release --bin ${{ steps.get_binary_type.outputs.BIN_NAME }}" strip: true - - name: Package and upload x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_version.outputs.BIN_NAME }} and CLI + - name: Package and upload x86_64-pc-windows-gnu for Ahnlich ${{ steps.get_binary_type.outputs.BIN_NAME }} 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 ../../../ + cd target/x86_64-pc-windows-gnu/release/ && zip ../../../win-x86_64-gnu-${{ steps.get_binary_type.outputs.BIN_NAME }}.zip ${{ steps.get_binary_type.outputs.BIN_NAME }}.exe && cd ../../../ + gh release upload ${{github.event.release.tag_name}} win-x86_64-gnu-${{ steps.get_binary_type.outputs.BIN_NAME }}.zip - 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 @@ -132,6 +109,7 @@ jobs: needs: build_binaries_and_publish name: Push Docker image to multiple registries runs-on: ubuntu-latest + if: ${{needs.build_binaries_and_publish.outputs.bin_name != 'ahnlich-cli'}} permissions: packages: write contents: read diff --git a/ahnlich/cli/Cargo.toml b/ahnlich/cli/Cargo.toml index 9245d808..9bed2c8c 100644 --- a/ahnlich/cli/Cargo.toml +++ b/ahnlich/cli/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [[bin]] -name = "ahnlich_cli" +name = "ahnlich-cli" path = "src/main.rs" [lib]