Fix: Upload only libzstd.dylib to releases #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
permissions: read-all | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
Build-in-Matrix: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ 'ubuntu-20.04', 'windows-2022', 'macos-12' ] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
name: Build on ${{ matrix.os }} | |
steps: | |
- name: Clone (Linux) | |
uses: actions/checkout@v4 | |
if: ${{ success() && startsWith(matrix.os, 'ubuntu') }} | |
with: | |
repository: facebook/zstd | |
ref: refs/tags/${{ github.ref_name }} | |
clean: true | |
fetch-depth: 1 | |
submodules: recursive | |
show-progress: false | |
persist-credentials: false | |
- name: Clone (Windows) | |
uses: actions/checkout@v4 | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
with: | |
clean: true | |
fetch-depth: 1 | |
show-progress: false | |
persist-credentials: false | |
- name: Clone (MacOS) | |
uses: actions/checkout@v4 | |
if: ${{ success() && startsWith(matrix.os, 'macos') }} | |
with: | |
repository: facebook/zstd | |
ref: refs/tags/${{ github.ref_name }} | |
clean: true | |
fetch-depth: 1 | |
submodules: recursive | |
show-progress: false | |
persist-credentials: false | |
- name: Setup Ninja (Windows) | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Setup Visual C++ | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
uses: TheMrMilchmann/setup-msvc-dev@v3 | |
with: | |
arch: x64 | |
- name: Configure vcpkg (Windows) | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
run: | | |
echo "VCPKG_TARGET_ARCHITECTURE=x64" >> "$($env:GITHUB_ENV)" | |
echo "VCPKG_ROOT=$($env:VCPKG_INSTALLATION_ROOT)" >> "$($env:GITHUB_ENV)" | |
echo "VCPKG_CRT_LINKAGE=static" >> "$($env:GITHUB_ENV)" | |
echo "VCPKG_BUILD_TYPE=release" >> "$($env:GITHUB_ENV)" | |
echo "VCPKG_LIBRARY_LINKAGE=dynamic" >> "$($env:GITHUB_ENV)" | |
echo "VCPKG_CMAKE_SYSTEM_NAME=Windows" >> "$($env:GITHUB_ENV)" | |
- name: Make (Linux) | |
if: ${{ success() && startsWith(matrix.os, 'ubuntu') }} | |
run: make lib-mt | |
env: | |
CFLAGS: '-Xlinker -Bsymbolic' | |
LDFLAGS: '-Xlinker -Bsymbolic' | |
- name: Make (MacOS) | |
if: ${{ success() && startsWith(matrix.os, 'macos') }} | |
run: make lib-mt | |
- name: CMake (Windows) | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
uses: threeal/cmake-action@v2 | |
with: | |
generator: Ninja | |
c-compiler: cl | |
cxx-compiler: cl | |
args: | | |
--preset=vcpkg | |
options: | | |
CMAKE_BUILD_TYPE=Release | |
CMAKE_MAKE_PROGRAM=ninja | |
- name: Upload (Linux) | |
if: ${{ success() && startsWith(matrix.os, 'ubuntu') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'libs-linux-${{ github.ref_name }}' | |
path: 'lib/**/*.so*' | |
- name: Upload (Windows) | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'libs-windows-${{ github.ref_name }}' | |
path: '**/*.dll' | |
- name: Upload (MacOS) | |
if: ${{ success() && startsWith(matrix.os, 'macos') }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: 'libs-macos-${{ github.ref_name }}' | |
path: '**/libzstd.dylib' | |
- name: Release (Linux) | |
if: ${{ success() && startsWith(matrix.os, 'ubuntu') }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '**/libzstd.so' | |
prerelease: true | |
name: 'zstd-${{ github.ref_name }}' | |
tag_name: '${{ github.ref_name }}' | |
fail_on_unmatched_files: true | |
body: | | |
Shared libraries of Zstandard ${{ github.ref_name }} | |
- name: Release (Windows) | |
if: ${{ success() && startsWith(matrix.os, 'windows') }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '**/build/zstd.dll' | |
prerelease: true | |
name: 'zstd-${{ github.ref_name }}' | |
tag_name: '${{ github.ref_name }}' | |
fail_on_unmatched_files: true | |
body: | | |
Shared libraries of Zstandard ${{ github.ref_name }} | |
- name: Release (MacOS) | |
if: ${{ success() && startsWith(matrix.os, 'macos') }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: '**/libzstd.dylib' | |
prerelease: true | |
name: 'zstd-${{ github.ref_name }}' | |
tag_name: '${{ github.ref_name }}' | |
fail_on_unmatched_files: true | |
body: | | |
Shared libraries of Zstandard ${{ github.ref_name }} |