Skip to content

Commit

Permalink
Fix the broken rename-netty-native-libs.sh script (apache#8598)
Browse files Browse the repository at this point in the history
*Motivation*

The script was broken after we upgraded the `netty-tc-native` version to `2.0.33.Final`.

This change fixes the script to make sure it is able to run on MacOS.
  • Loading branch information
sijie authored Nov 18, 2020
1 parent 76b3f35 commit 74ce5f4
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 1 deletion.
76 changes: 76 additions & 0 deletions .github/workflows/ci-build-multi-os.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

name: CI - Build - Multiple - OS
on:
pull_request:
branches:
- master
push:
branches:
- branch-*

env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3

jobs:

build:
name:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
timeout-minutes: 120

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 25
ref: ${{ github.event.pull_request.head.sha }}

- name: Check if this pull request only changes documentation
id: docs
uses: apache/pulsar-test-infra/diff-only@master
with:
args: site2 deployment .asf.yaml .ci ct.yaml

- name: Cache local Maven repository
if: steps.docs.outputs.changed_only == 'no'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
if: steps.docs.outputs.changed_only == 'no'
with:
java-version: 1.8

- name: build package
if: steps.docs.outputs.changed_only == 'no'
run: mvn clean install -DskipTests
9 changes: 8 additions & 1 deletion src/rename-netty-native-libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ FILES_TO_RENAME=(

echo "----- Renaming epoll lib in $JAR_PATH ------"
TMP_DIR=`mktemp -d`
unzip -q $JAR_PATH -d $TMP_DIR
CUR_DIR=$(pwd)
cd ${TMP_DIR}
# exclude `META-INF/LICENSE`
unzip -q $JAR_PATH -x "META-INF/LICENSE"
# include `META-INF/LICENSE` as LICENSE.netty.
# This approach is to get around the issue that MacOS is not able to recognize the difference between `META-INF/LICENSE` and `META-INF/license/`.
unzip -p $JAR_PATH META-INF/LICENSE > META-INF/LICENSE.netty
cd ${CUR_DIR}

pushd $TMP_DIR

Expand Down

0 comments on commit 74ce5f4

Please sign in to comment.