Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,57 @@ jobs:
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
Comment thread
vazub marked this conversation as resolved.
os: ubuntu-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0 # needed for git-describe version
fetch-depth: 0 # needed for git-describe version

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross-compilation tools
- name: Install cross-compilation tools (aarch64-gnu)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV

Comment thread
chojiai[bot] marked this conversation as resolved.
- name: Install musl tools (x86_64-musl)
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt-get update
Comment thread
chojiai[bot] marked this conversation as resolved.
sudo apt-get install -y musl-tools

- name: Install cross (aarch64-musl)
if: matrix.target == 'aarch64-unknown-linux-musl'
uses: taiki-e/install-action@v2
with:
tool: cross@0.2.5

- name: Build
if: matrix.target != 'aarch64-unknown-linux-musl'
run: cargo build --release --target ${{ matrix.target }} -p loon-cli

- name: Build (cross)
if: matrix.target == 'aarch64-unknown-linux-musl'
run: cross build --release --target ${{ matrix.target }} -p loon-cli

- name: Verify static linking
if: contains(matrix.target, 'musl')
run: |
file target/${{ matrix.target }}/release/loon
ldd target/${{ matrix.target }}/release/loon || true

- name: Package
run: |
TAG=${GITHUB_REF#refs/tags/}
Expand All @@ -48,7 +75,7 @@ jobs:
tar czf "$ARCHIVE" loon
Comment thread
vazub marked this conversation as resolved.
echo "ARCHIVE=$ARCHIVE" >> $GITHUB_ENV

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v6
with:
name: ${{ matrix.target }}
path: ${{ env.ARCHIVE }}
Expand All @@ -57,7 +84,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
Comment thread
vazub marked this conversation as resolved.
with:
merge-multiple: true

Expand Down