Skip to content

Commit

Permalink
chore: ${{ env.環境変数 }}$環境変数
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Aug 30, 2024
1 parent 03b3195 commit 6d91651
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:

- name: Version check (semver)
run: |
VERSION="${{ env.ONNXRUNTIME_VERSION }}"
VERSION=$ONNXRUNTIME_VERSION
if [[ $VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(-([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$ ]]; then
echo "Version: $VERSION"
else
Expand Down Expand Up @@ -284,8 +284,8 @@ jobs:
git \
wget \
qemu-user-binfmt \
gcc-${{ matrix.cc_version }}${{ env.ARCH_SUFFIX }} \
g++-${{ matrix.cxx_version }}${{ env.ARCH_SUFFIX }}
gcc-${{ matrix.cc_version }}"$ARCH_SUFFIX" \
g++-${{ matrix.cxx_version }}"$ARCH_SUFFIX"
- name: Install build dependencies on macos
if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'macos')
Expand All @@ -299,7 +299,7 @@ jobs:
env:
CMAKE_VERSION: 3.27.7
run: |
wget -O cmake.sh "https://github.com/Kitware/CMake/releases/download/v${{ env.CMAKE_VERSION }}/cmake-${{ env.CMAKE_VERSION }}-linux-x86_64.sh"
wget -O cmake.sh "https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh"
sudo bash cmake.sh --skip-license --prefix=/usr/local
- name: Set up CUDA
Expand Down Expand Up @@ -353,8 +353,8 @@ jobs:
fi
# Set environment variable CC / CXX
echo "CC=${{ env.ARCH_PREFIX }}gcc-${{ matrix.cc_version }}" >> "$GITHUB_ENV"
echo "CXX=${{ env.ARCH_PREFIX }}g++-${{ matrix.cxx_version }}" >> "$GITHUB_ENV"
echo CC="$ARCH_PREFIX"gcc-${{ matrix.cc_version }} >> "$GITHUB_ENV"
echo CXX="$ARCH_PREFIX"g++-${{ matrix.cxx_version }} >> "$GITHUB_ENV"
- name: Configure to use latest Android NDK
if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && startsWith(matrix.artifact_name, 'onnxruntime-android')
Expand Down Expand Up @@ -405,11 +405,11 @@ jobs:
if [[ "$ARTIFACT_NAME" == onnxruntime-win-* ]]; then
ONNXRUNTIME_NAME=onnxruntime.dll
elif [[ "$ARTIFACT_NAME" == onnxruntime-linux-* ]]; then
ONNXRUNTIME_NAME=libonnxruntime.so.${{ env.ONNXRUNTIME_VERSION }}
ONNXRUNTIME_NAME="libonnxruntime.so.$ONNXRUNTIME_VERSION"
elif [[ "$ARTIFACT_NAME" == onnxruntime-android-* ]]; then
ONNXRUNTIME_NAME=libonnxruntime.so
elif [[ "$ARTIFACT_NAME" == onnxruntime-osx-* ]] || [[ "$ARTIFACT_NAME" == onnxruntime-ios-* ]]; then
ONNXRUNTIME_NAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib
ONNXRUNTIME_NAME="libonnxruntime.$ONNXRUNTIME_VERSION.dylib"
else
echo "Unknown target found : ${{ matrix.artifact_name }}"
return 1
Expand All @@ -431,7 +431,7 @@ jobs:
./tools/ci_build/github/linux/copy_strip_binary.sh \
-r ${{ matrix.result_dir }} \
-a ${{ matrix.artifact_name }} \
-l $ONNXRUNTIME_NAME \
-l "$ONNXRUNTIME_NAME" \
-c ${{ matrix.release_config }} \
-s "$(pwd)" \
-t "$(git rev-parse HEAD)"
Expand All @@ -446,7 +446,7 @@ jobs:

- name: Generate RELEASE_NAME
run: |
echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> "$GITHUB_ENV"
echo RELEASE_NAME=${{ matrix.artifact_name }}-"$ONNXRUNTIME_VERSION" >> "$GITHUB_ENV"
- name: Generate specifications
run: |
Expand Down Expand Up @@ -499,8 +499,8 @@ jobs:
- name: Rearchive artifact
if: env.RELEASE == 'true'
run: |
mv artifact/ "${{ env.RELEASE_NAME }}"
tar cfz "${{ env.RELEASE_NAME }}.tgz" "${{ env.RELEASE_NAME }}/"
mv artifact/ "$RELEASE_NAME"
tar cfz "$RELEASE_NAME.tgz" "$RELEASE_NAME/"
- name: Upload to Release
if: env.RELEASE == 'true'
Expand All @@ -519,10 +519,10 @@ jobs:
- name: Generate RELEASE_NAME and ONNXRUNTIME_BASENAME
id: gen-envs
run: |
RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}
RELEASE_NAME=onnxruntime-ios-xcframework-$ONNXRUNTIME_VERSION
echo "release-name=$RELEASE_NAME" >> "$GITHUB_OUTPUT"
echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV"
echo "ONNXRUNTIME_BASENAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib" >> "$GITHUB_ENV"
echo "ONNXRUNTIME_BASENAME=libonnxruntime.$ONNXRUNTIME_VERSION.dylib" >> "$GITHUB_ENV"
- uses: actions/checkout@v3

Expand Down Expand Up @@ -552,7 +552,7 @@ jobs:
mkdir -p "Framework-aarch64"
cp -vr xcframework/Frameworks/aarch64/ Framework-aarch64/
lipo -create "artifact/onnxruntime-aarch64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
lipo -create "artifact/onnxruntime-aarch64-apple-ios/lib/$ONNXRUNTIME_BASENAME" \
-output "Framework-aarch64/onnxruntime.framework/onnxruntime"
- name: Change aarch64 @rpath
Expand All @@ -563,8 +563,8 @@ jobs:
- name: Create fat binary
run: |
mkdir -p "artifact/onnxruntime-sim"
lipo -create "artifact/onnxruntime-x86_64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
"artifact/onnxruntime-aarch64-apple-ios-sim/lib/${{ env.ONNXRUNTIME_BASENAME }}" \
lipo -create "artifact/onnxruntime-x86_64-apple-ios/lib/$ONNXRUNTIME_BASENAME" \
"artifact/onnxruntime-aarch64-apple-ios-sim/lib/$ONNXRUNTIME_BASENAME" \
-output "artifact/onnxruntime-sim/onnxruntime"
- name: Create sim Framework
Expand All @@ -581,16 +581,16 @@ jobs:
- name: Create XCFramework
run: |
mkdir -p "artifact/${{ env.ONNXRUNTIME_BASENAME }}"
mkdir -p "artifact/$ONNXRUNTIME_BASENAME"
xcodebuild -create-xcframework \
-framework Framework-sim/onnxruntime.framework \
-framework Framework-aarch64/onnxruntime.framework \
-output "artifact/${{ env.ONNXRUNTIME_BASENAME }}/onnxruntime.xcframework"
-output "artifact/$ONNXRUNTIME_BASENAME/onnxruntime.xcframework"
- name: Archive artifact
run: |
cd artifact/${{ env.ONNXRUNTIME_BASENAME }}
7z a "../../${{ env.RELEASE_NAME }}.zip" "onnxruntime.xcframework"
cd "artifact/$ONNXRUNTIME_BASENAME"
7z a "../../$RELEASE_NAME.zip" "onnxruntime.xcframework"
- name: Upload to Release
if: env.RELEASE == 'true'
Expand Down

0 comments on commit 6d91651

Please sign in to comment.