Skip to content

Commit

Permalink
feat: update release workflow to include additional target platforms …
Browse files Browse the repository at this point in the history
…for building binaries
  • Loading branch information
dwpeng committed Nov 1, 2024
1 parent 8ee1baa commit c746e8f
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
# - target: x86_64-pc-windows-msvc
# os: windows-latest
# cross: false
# - target: x86_64-apple-darwin
# os: macos-latest
# cross: false
# - target: aarch64-apple-darwin
# os: macos-latest
# cross: false
- target: x86_64-pc-windows-msvc
os: windows-latest
cross: false
- target: x86_64-apple-darwin
os: macos-latest
cross: false
- target: aarch64-apple-darwin
os: macos-latest
cross: false

steps:
- uses: actions/checkout@v4
Expand All @@ -40,28 +40,37 @@ jobs:
cargo install cargo-zigbuild
rustup target add ${{ matrix.target }}
cargo zigbuild -p filterx --release --target ${{ matrix.target }}.2.17
mkdir -p target/${{ matrix.target }}.2.17/release
cp target/${{ matrix.target }}/release/filterx target/${{ matrix.target }}.2.17/release/filterx
cargo zigbuild -p filterx --release --target ${{ matrix.target }}
- name: Build windows/mac binaries
if: ${{ !matrix.cross }}
run: |
cargo install cargo-zigbuild
rustup target add ${{ matrix.target }}
cargo zigbuild -p filterx --release --target ${{ matrix.target }}
cargo build -p filterx --release --target ${{ matrix.target }}
- name: create artifact directory
shell: bash
run: |
echo "target: ${{ matrix.target }}"
directory=filterx-${{ matrix.target }}
mkdir $directory
cp target/${{ matrix.target }}/release/filterx $directory
tar cJf $directory.tar.xz $directory/
echo "artifact: $directory.tar.xz"
if [ -f target/${{ matrix.target }}.2.17/release/filterx ]; then
mkdir $directory.2.17
cp target/${{ matrix.target }}.2.17/release/filterx $directory.2.17
tar cJf $directory.2.17.tar.xz $directory.2.17/
echo "artifact: $directory.2.17.tar.xz"
if [ -f target/${{ matrix.target }}/release/filterx ]; then
cp target/${{ matrix.target }}/release/filterx $directory/
tar cJf $directory.tar.xz $directory/
echo "artifact: $directory.tar.xz"
if [ -f target/${{ matrix.target }}.2.17/release/filterx ]; then
mkdir $directory.2.17
cp target/${{ matrix.target }}.2.17/release/filterx $directory.2.17/
tar cJf $directory.2.17.tar.xz $directory.2.17/
echo "artifact: $directory.2.17.tar.xz"
fi
fi
if [ -f target/${{ matrix.target }}/release/filterx.exe ]; then
cp target/${{ matrix.target }}/release/filterx.exe $directory/
7z a $directory.zip $directory/
echo "artifact: $directory.zip"
fi
- uses: ncipollo/release-action@v1.14.0
Expand Down

0 comments on commit c746e8f

Please sign in to comment.