Skip to content

Commit

Permalink
Rename artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Oct 29, 2024
1 parent a11f3d8 commit 68d35b0
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,28 @@ jobs:
github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }}

builds:
name: Build for ${{ matrix.job.target }} on ${{ matrix.job.os }}
runs-on: ${{ matrix.job.os }}
name: Build for ${{ matrix.build.target }} on ${{ matrix.build.os }}
runs-on: ${{ matrix.build.os }}
needs: tag
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-gnu, arch: amd64, os: ubuntu-20.04 }
- { target: aarch64-apple-darwin, arch: darwin, os: macos-14 }
- { target: x86_64-pc-windows-msvc, arch: win64, os: windows-2019 }
build:
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
- { target: aarch64-apple-darwin, os: macos-14 }
- { target: x86_64-pc-windows-msvc, os: windows-2019 }

steps:
- if: contains(matrix.job.os, 'ubuntu')
name: Install dependencies
- if: contains(matrix.build.os, 'ubuntu')
name: Install dependencies (Ubuntu)
run: |
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:wireshark-dev/stable
sudo apt install -y wireshark-dev
sudo apt install -y --allow-change-held-packages wireshark
- if: contains(matrix.job.os, 'windows')
name: Install dependencies
- if: contains(matrix.build.os, 'windows')
name: Install dependencies (Windows)
run: |
$installed = (choco list -l -r --id-only) -join " "
$install_list = @("xsltproc", "docbook-bundle", "nsis", "winflexbison3", "cmake", "7zip")
Expand All @@ -104,8 +104,8 @@ jobs:
}
choco install -y --no-progress wireshark --version 4.2.0
- if: contains(matrix.job.os, 'macos')
name: Install dependencies
- if: contains(matrix.build.os, 'macos')
name: Install dependencies (macOS)
run: |
brew install --cask wireshark
ln -snf $(find /Applications/Wireshark.app/Contents/Frameworks -name "libwireshark.*.dylib" | tail -n 1) libwireshark.dylib
Expand All @@ -116,10 +116,10 @@ jobs:
ref: ${{ needs.tag.outputs.branch }}

- name: Setup the Wireshark library
id: wireshark_lib
id: wireshark-lib
shell: bash
run: |
case ${{ matrix.job.target }} in
case ${{ matrix.build.target }} in
*linux*)
echo "WIRESHARK_LIB_DIR=" >> $GITHUB_OUTPUT
;;
Expand All @@ -133,14 +133,14 @@ jobs:
esac
- name: Build
if: ${{! contains(matrix.job.target, 'windows') }}
if: ${{! contains(matrix.build.target, 'windows') }}
run: cargo build --release
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
WIRESHARK_LIB_DIR: ${{ steps.wireshark_lib.outputs.WIRESHARK_LIB_DIR }}
WIRESHARK_LIB_DIR: ${{ steps.wireshark-lib.outputs.WIRESHARK_LIB_DIR }}

- name: Build from source on Windows
if: contains(matrix.job.target, 'windows')
if: contains(matrix.build.target, 'windows')
run: cargo build --release
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
Expand All @@ -149,27 +149,30 @@ jobs:
id: package
shell: bash
run: |
PKG_NAME="${GITHUB_WORKSPACE}/${{ matrix.job.target }}.zip"
echo "Packaging ${PKG_NAME}:"
case ${{ matrix.job.target }} in
PKG_NAME=zenoh-dissector-${{ needs.tag.outputs.version }}-${{ matrix.build.target }}-standalone.zip"
PKG_PATH="${GITHUB_WORKSPACE}/${{ matrix.build.target }}.zip"
echo "Packaging ${PKG_PATH}:"
case ${{ matrix.build.target }} in
*linux*)
zip -j ${PKG_NAME} target/release/libzenoh_dissector.so
zip -j ${PKG_PATH} target/release/libzenoh_dissector.so
;;
*apple*)
mv target/release/libzenoh_dissector.dylib target/release/libzenoh_dissector.so
zip -j ${PKG_NAME} target/release/libzenoh_dissector.so
zip -j ${PKG_PATH} target/release/libzenoh_dissector.so
;;
*windows*)
PKG_NAME="${PKG_NAME//\\//}"
zip -j ${PKG_NAME} target/release/zenoh_dissector.dll
PKG_PATH="${PKG_PATH//\\//}"
zip -j ${PKG_PATH} target/release/zenoh_dissector.dll
;;
esac
echo "name=$PKG_NAME" >> $GITHUB_OUPUT
echo "path=$PKG_PATH" >> $GITHUB_OUPUT
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.job.target }}
path: ${{ matrix.job.target }}.zip
name: ${{ steps.package.outputs.name }}
path: ${{ steps.package.outputs.path }}
if-no-files-found: error

publish:
Expand Down

0 comments on commit 68d35b0

Please sign in to comment.