-
Notifications
You must be signed in to change notification settings - Fork 0
Build MQ Tool for arm linux and arm macos #24
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,14 @@ jobs: | |||||
| matrix: | ||||||
| include: | ||||||
| - target: x86_64-unknown-linux-gnu | ||||||
| runs-on: [ubuntu-22.04] | ||||||
| runs-on: ubuntu-22.04 | ||||||
| os: linux | ||||||
| - target: aarch64-unknown-linux-gnu | ||||||
| runs-on: ubuntu-22.04 | ||||||
| os: linux | ||||||
| - target: aarch64-apple-darwin | ||||||
| runs-on: macos-14 | ||||||
| os: macos | ||||||
| runs-on: ${{ matrix.runs-on }} | ||||||
|
|
||||||
| steps: | ||||||
|
|
@@ -25,20 +32,25 @@ jobs: | |||||
| - name: Set up toolchains | ||||||
| run: | | ||||||
| rustup target add ${{ matrix.target }} | ||||||
| if [[ ${{ matrix.target }} == "aarch64-unknown-linux-gnu" ]]; then | ||||||
| if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then | ||||||
| sudo apt update; | ||||||
| sudo apt install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu; | ||||||
| fi | ||||||
|
|
||||||
| - name: update version | ||||||
| run: | ||||||
| sed -i "s/version = \"0.0.0\"/version = \"${{ github.event.inputs.release_tag }}\"/" | ||||||
| Cargo.toml | ||||||
| run: | | ||||||
| if [[ "${{ runner.os }}" == "macOS" ]]; then | ||||||
| sed -i '' "s/version = \"0.0.0\"/version = \"${{ github.event.inputs.release_tag }}\"/" Cargo.toml | ||||||
| else | ||||||
| sed -i "s/version = \"0.0.0\"/version = \"${{ github.event.inputs.release_tag }}\"/" Cargo.toml | ||||||
| fi | ||||||
|
|
||||||
| - name: Build --release | ||||||
| run: cargo build --release --target ${{ matrix.target }} | ||||||
| env: | ||||||
| HORTON_RELEASE: ${{ github.event.inputs.release_tag }} | ||||||
| CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc | ||||||
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | ||||||
|
|
||||||
| - uses: actions/upload-artifact@v4 | ||||||
| with: | ||||||
|
|
@@ -68,14 +80,22 @@ jobs: | |||||
| for target in $(ls build) | ||||||
| do | ||||||
| chmod u+x build/${target}/mq | ||||||
| tar czvf \ | ||||||
| build/mq-${{ github.event.inputs.release_tag }}-${target}.tar.gz \ | ||||||
| -C build/${target} mq | ||||||
| if [[ "${target}" == *"apple-darwin"* ]]; then | ||||||
| # macOS binaries use zip format | ||||||
| cd build/${target} | ||||||
| zip ../mq-${{ github.event.inputs.release_tag }}-${target}.zip mq | ||||||
| cd ../.. | ||||||
| else | ||||||
| # Linux binaries use tar.gz format | ||||||
| tar czvf \ | ||||||
| build/mq-${{ github.event.inputs.release_tag }}-${target}.tar.gz \ | ||||||
| -C build/${target} mq | ||||||
| fi | ||||||
| done | ||||||
|
|
||||||
| - name: Create GH release and upload binary | ||||||
| env: | ||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
| run: | | ||||||
| gh release create --target ${{ github.ref }} \ | ||||||
| ${{ github.event.inputs.release_tag }} ./build/*.tar.gz --generate-notes | ||||||
| ${{ github.event.inputs.release_tag }} ./build/*.{tar.gz,zip} --generate-notes | ||||||
|
||||||
| ${{ github.event.inputs.release_tag }} ./build/*.{tar.gz,zip} --generate-notes | |
| ${{ github.event.inputs.release_tag }} $(find ./build -maxdepth 1 -type f \( -name "*.tar.gz" -o -name "*.zip" \)) --generate-notes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The glob pattern './build/.{tar.gz,zip}' may not work as expected in bash. If no .zip files exist, the literal string './build/.zip' will be passed to gh release. Consider using a more robust approach like 'shopt -s nullglob' before the command or finding files explicitly with 'find'.