diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f882bd..4b4414b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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