Skip to content

Commit

Permalink
Fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Barre committed Oct 6, 2024
1 parent 359fa14 commit 961d7f9
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Rust Build and Release

on:
push:
branches: [ "master" ]

branches: ["master"]

env:
CARGO_TERM_COLOR: always
Expand All @@ -14,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
Expand All @@ -39,14 +38,38 @@ jobs:
command: build
args: --release --target ${{ matrix.target }}

- name: Package Binary
- name: Debug - List build directory
shell: bash
run: |
binary_name="merklemap-cli"
echo "Listing target/${{ matrix.target }}/release directory:"
ls -la target/${{ matrix.target }}/release
- name: Set binary name
run: |
BINARY_NAME="merklemap-cli"
if [ "${{ matrix.os }}" = "windows-latest" ]; then
binary_name="${binary_name}.exe"
BINARY_NAME="${BINARY_NAME}.exe"
fi
echo "BINARY_NAME=${BINARY_NAME}" >> $GITHUB_ENV
- name: Package Binary
shell: bash
run: |
echo "Packaging binary from: target/${{ matrix.target }}/release/${BINARY_NAME}"
if [ -f "target/${{ matrix.target }}/release/${BINARY_NAME}" ]; then
echo "Binary file exists"
tar -czvf "${BINARY_NAME}-${{ matrix.target }}.tar.gz" -C "target/${{ matrix.target }}/release" "${BINARY_NAME}"
echo "Packaging complete"
else
echo "Error: Binary file not found"
exit 1
fi
tar -czf "${binary_name}-${{ matrix.target }}.tar.gz" -C "target/${{ matrix.target }}/release" "${binary_name}"
- name: Debug - List workspace
shell: bash
run: |
echo "Listing current directory:"
ls -la
- name: Upload Artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 961d7f9

Please sign in to comment.